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 UP and DOWN functions, but the scroll function!
And I wanted that as soon as the mouse roll was fired the function would be executed.
Is this possible?