标签:鼠标 ret win document dev val amp listen prevent
滚轮事件兼容写法
document.addEventListener("mousewheel",fn,false)
document.addEventListener("DOMMousewheel",fn,false)
function fn(evt){
var event=evt||window.event;
if(event&&event.preventDefalult){
event.preventDefault();
}else{
event.returnValue=false;
}
}
标签:鼠标 ret win document dev val amp listen prevent
原文地址:https://www.cnblogs.com/aaaaap/p/11686845.html