he easiest way for me to tell was...
var tempScrollTop, currentScrollTop = 0;
$("#div").scroll(function(){
currentScrollTop = $("#div").scrollTop();
if (tempScrollTop < currentScrollTop )
//scrolling down
else if (tempScrollTop > currentScrollTop )
//scrolling up
//scrolling down
else if (tempScrollTop > currentScrollTop )
//scrolling up
tempScrollTop = currentScrollTop;
}
}
This works with mousewheel, up/down arrows, and slidebar
沒有留言:
張貼留言