On a webpage, I use a couple of audio tags for mouse sounds and a video tag for playing videos.
Now that the video is playing, the sound should be stopped and muted. The sound starts as follows:
$(this).mouseover(function() { $('audio#' + $(this).attr('title') + '_sound').trigger('play'); });
Now you need to add something like this, I tried a couple of things that none of them work:
$(this).mouseover(function() { if($('#video') is NOT playing) { $('audio#' + $(this).attr('title') + '_sound').trigger('play'); } });
Has anyone done something like this before?
Any help is appreciated :-)
Thanks!
source share