作者:我是小钞票 | 来源:互联网 | 2023-09-23 18:28
I'm looking to get an event to fire when one scrolls "up" from $(window).scrollTop == 0
.
我正在寻找一个事件,当一个滚动“向上”从$(窗口)。scrollTop = = 0。
If you have the following code:
如果您有以下代码:
$(window).scroll(function(){
console.log("scrolling")
});
On a page where the document $(window).scrollTop isn't changing, but this doesn't mean that there's no mouse scroll input. I want an event to fire on mouse scroll regardless if the page is moving or not.
在文档 <窗口高度的页面上,因为$(窗口)而不会触发事件。scrolltop没有变化,但这并不意味着没有鼠标滚动输入。无论页面是否移动,我都希望在鼠标滚屏上触发一个事件。
2 个解决方案