标签:als web dde 鼠标 false mouse onkeydown scroll 恢复
禁止鼠标滑过滚动条滚动
document.body.onmousewheel = function () {return false;}
恢复鼠标滑过滚动条滚动
document.body.onmousewheel = function () {return true;}
禁止键盘控制滚动条滚动
document.body.onkeydown = function (e) {
if (e.keyCode == 38 || e.keyCode == 40) {
return false;
}
}
恢复键盘控制滚动条滚动
document.body.onkeydown = function (e) {
if (e.keyCode == 38 || e.keyCode == 40) {
return true;
}
}
css隐藏滚动条样式:
::-webkit-scrollbar {
overflow-x:hidden;
}
标签:als web dde 鼠标 false mouse onkeydown scroll 恢复
原文地址:https://www.cnblogs.com/maohuidong/p/12548876.html