AleMal
AleMal

Reputation: 2077

Javascript scroll event cross browser

In my project i need to grab some parameters related to scroll event on a page like start datetime, stop datetime, ycoords on start scrolling and ycoords on stop. I need to trap only the start and stop of the scroll events but i know that in JavaScript there isn't methods for this purpose. Any idea for doing it with all major browser compatibility?

Thanks in advance

Upvotes: 0

Views: 991

Answers (1)

user28470
user28470

Reputation: 429

http://jsfiddle.net/hYsRh/4/

    $(window).scroll($.debounce( 250, true, function(){
        $('#scrollMsg').html('SCROLLING!');
    }));
    $(window).scroll($.debounce( 250, function(){
        $('#scrollMsg').html('DONE!');
    }));

jQuery debounce

Upvotes: 2

Related Questions