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;

posted @ 2014-12-22 11:59  子慕大诗人  阅读(1917)  评论(1编辑  收藏  举报