5
Is there any way in jQuery to capture the events of "Scrolldown" and "Scrollup"?
I tried this way:
var lastScrollTop = 0;
$(window).scroll(function(event){
var st = $(this).scrollTop();
if (st > lastScrollTop){
// downscroll code
} else {
// upscroll code
}
lastScrollTop = st;
});
But it does not capture the function of UP and DOWN but the scroll any!
And I wanted that as soon as the mouse bearing was triggered the function was executed.
That’s possible ?
Samir, by the way, this answer was what I was looking for?
– Sergio