On this site, on the music part you can listen a track maintaining your click on it. Below some snippets to play with this opportunity. :-)
edit : actually it may not be intended, it works with Safari.
// or just basic version | |
$('.playToggle').click(function (e) { $(this).trigger({type: 'mousedown'}); }); |
// play one of the three playable song | |
var playSong = function (songNumber) { | |
if (songNumber > 2 || songNumber < 0) { return; } | |
$('.playToggle') | |
.eq(songNumber-1) | |
.trigger({type: 'mousedown'}); | |
}; |
// play a random song whenever moving the mouse | |
window.onmousemove = function () { | |
playSong(Math.round(Math.random() *3)); | |
}; |