itemCurrently when I hover a HTML element, a song is played. Now, I would like to create a simple circle reacting with that sound (bouncing, or vibrating effect), I just don't know where to look to achieve that kind of stuff maybe plain Javascript or the Web Audio API ?
The code to play sound:
$('.item').on('mouseenter', function(){
itemId = $(this).attr('data-id');
if (document.getElementById(coverId).tagName == 'AUDIO' ) {
$('#' + itemId).trigger("play");
}
});
$('.item').on('mouseleave', function(){
itemId = $(this).attr('data-id');
if (document.getElementById(itemId).tagName == 'AUDIO' ) {
// For audio replay
var audio = document.getElementById(itemId);
audio.pause();
audio.currentTime = 0;
audio.load();
} else {
$('#' + itemId).trigger("pause");
}
});
Any help would be very appreciated! Thanks!