如果用户正在滚动,如何在javascript中检测?
this works:(这有效:)
window.onscroll = function (e) { // called when the window is scrolled. }
userHasScrolled = false; window.onscroll = function (e) { userHasScrolled = true; }
if(userHasScrolled) { //do your code here userHasScrolled = false; }
1.4m articles
1.4m replys
5 comments
57.0k users