这两个代码都实现不了禁止滚轮滑动
window.onload = function () {
window.onmousewheel = document.onmousewheel = function () { return false }
}
window.addEventListener('wheel',function(){
return false
})
这两个代码都实现不了禁止滚轮滑动
window.onload = function () {
window.onmousewheel = document.onmousewheel = function () { return false }
}
window.addEventListener('wheel',function(){
return false
})
document.addEventListener('wheel', function(event) {
event.preventDefault(); // 阻止默认的滚轮行为
}, { passive: false });