JQery /HTML5 Audio file Fade 2
Hi
OK after much tinkering I've given up. An descriptionof what I'd like to achieve: User scrolls down the page the sound fades in. Scroll up the page the sound fades out. I want to be able to control (more or less) at what point on the scroll the sound fades in/out. Please be aware there are other sounds playing as well I don't want to affect if possible. If this proves too difficult then I don't care if the others sounds fade out as well.
I'm using a specific plugin called volumizer found on post called
Here is some code that doesn't work at all but it give you and idea of what I'm trying for:
HTML:
<audio loop id="soundTour3" src="audio/smooth_beat.mp3"></audio>
JAVASCRIPT:
</script><script type="text/javascript" charset="utf-8">
$(document).ready(function() {
var audioElm = $('#soundTour3').get(0);
audioElm.volume = 0
audioElm.play();
});
$(window).scroll(function(){
// gets the position of the window
var y = $(window).scrollTop();
if( y > (500) ){
$('#soundTour3').volumizer({1:[5,10000]})
if( y < (500) ){
$('#soundTour3').volumizer({1:[5,.0001]})
});
</script>