$(document).on('mousewheel DOMMouseScroll', onMouseScroll);
function onMouseScroll(e){
e.preventDefault();
var wheel = e.originalEvent.wheelDelta || -e.originalEvent.detail;
var delta = Math.max(-1, Math.min(1, wheel) );
var h=$(window).scrollTop(); //获取当前滚动条距离顶部的位置
if(delta<0){//向下滚动
$("html,body").animate({ scrollTop: h+850 }, 500);//点击按钮向下移动800px,时间为800毫秒
}else{//向上滚动
$("html,body").animate({ scrollTop: h-850 }, 500);//点击按钮向下移动800px,时间为800毫秒
}
}
需要引入jquery
在onmousemove里