如何在 javascript 中检测用户是否正在滚动?
这有效:
window.onscroll = function (e) {
// called when the window is scrolled.
}
edit:
你说这是一个 TimeInterval 中的函数..
尝试这样做:
userHasScrolled = false;
window.onscroll = function (e)
{
userHasScrolled = true;
}
然后在你的 Interval 中插入:
if(userHasScrolled)
{
//do your code here
userHasScrolled = false;
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)