JS禁用鼠标滚轮事件

function disabledMouseWheel() {
  if (document.addEventListener) {
    document.addEventListener('DOMMouseScroll', scrollFunc, false);
  }//W3C
  window.onmousewheel = document.onmousewheel = scrollFunc;//IE/Opera/Chrome
}
function scrollFunc(evt) {
  return false;
}
window.onload=disabledMouseWheel;

你可能感兴趣的:(JS禁用鼠标滚轮事件)