function disabledMouseWheel() {
    var div = document.getElementById('divid');
    if (div.addEventListener) {
        div.addEventListener('DOMMouseScroll', scrollFunc, false);
    }//W3C
    div.onmousewheel = div.onmousewheel = scrollFunc;//IE/Opera/Chrome
}
 
function scrollFunc(evt) {
    evt = evt || window.event;
    if (evt.preventDefault) {
        // Firefox
        evt.preventDefault();
        evt.stopPropagation();
    } else {
        // IE
        evt.cancelBubble = true;
        evt.returnValue = false;
    }
    return false;
}
 
window.onload = disabledMouseWheel;

  

  已做兼容 亲测可用,

posted on 2018-08-31 18:33  斧子兔  阅读(2391)  评论(0编辑  收藏  举报