2019-06-26 内部滚动,外部不滚动

const closeScorll = (obj, maxBodyHeight) => {
obj.onmousewheel = (event) => {
if (obj.scrollTop > maxBodyHeight && event.deltaY > 0) {
event.preventDefault();
}

    if (obj.scrollTop === 0 && event.deltaY <= 0) {
      event.preventDefault();
    }
  };
};

closeScorll(dom, 985);

你可能感兴趣的:(2019-06-26 内部滚动,外部不滚动)