STYLE SWITCHER

Fade HTML5 audio (adjust volume) using jQuery (window).scroll

$(document).ready(function() {
    var audioElm = $('#soundTour').get(0);
    audioElm.play();

    var height = $(document).height() - $(window).height();

    $(window).scroll(function() {
        audioElm.volume = 1 - $(window).scrollTop() / height;
        console.log(audioElm.volume);
    });
});​

Recent Article

Leave a Reply

Your email address will not be published. Required fields are marked *