各位大佬:
我有一段js代码,使用的是 jquery的animate 方法,我需要在这段代码运行时,
监听鼠标滚轮的动作,如果有鼠标滚轮的动作,就退出这个animate方法,请教怎么写代码?
附:
window.onload = function () { setTimeout(autorollup,3000); function autorollup(){ $("#part2").animate({top: "-=800px"}, 8000); }
感谢不吝赐教!
Copyright 2014-2024 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
http://xf0c11m.cn/ 派派网 在线查看
添加事件监听即可,window.addEventListener("wheel", 回调函数);