Introduction:
Below jQuery code detects whether user is scrolling up or down in the webpage.
Example:
Below jQuery code detects whether user is scrolling up or down in the webpage.
Example:
var iScrollPos = 0;
$(window).scroll(function () {
var iCurScrollPos = $(this).scrollTop();
if (iCurScrollPos > iScrollPos) {
//Scrolling Down
} else {
//Scrolling Up
}
iScrollPos = iCurScrollPos;
});
0 comments :
Post a Comment