JS阻止鼠标滚动
var scrollFunc=function(e){
e=e || window.event;
if (e.stopPropagation) e.stopPropagation();
else e.cancelBubble = true;
if (e.preventDefault) e.preventDefault();
else e.returnValue = false;
}
if( document.addEventListener){ document.addEventListener('DOMMouseScroll',scrollFunc,false); }
window.onmousewheel=document.onmousewheel=scrollFunc;
![](https://images2015.cnblogs.com/blog/623144/201607/623144-20160704153736327-1290497568.png)
有没有人打赏?没有的话,那我晚点再来问问。
![](https://img2018.cnblogs.com/blog/623144/201903/623144-20190319194730266-1448057040.png)
关注大诗人公众号,第一时间获取最新文章。
---转发请标明,并添加原文链接---