📅  最后修改于: 2022-03-11 15:00:16.045000             🧑  作者: Mango
var lastScrollTop = 0, delta = 5;
$(window).scroll(function () {
var nowScrollTop = $(this).scrollTop();
if (Math.abs(lastScrollTop - nowScrollTop) >= delta) {
if (nowScrollTop > lastScrollTop) {
// SCROLLING Down
} else {
//scroll top
}
lastScrollTop = nowScrollTop;
}
});