除非使用滚动条,否则使用鼠标滚动阻止内容向下滚动

时间:2015-06-17 04:05:17

标签: css web scroll non-scrolling

如何使内容无法通过鼠标滚轮滚动,而只能使用滚动条向下滚动。

非常感谢。

3 个答案:

答案 0 :(得分:0)

你可以使用jQuery。像这样的东西

$("body").bind("mousewheel", function() {
     return false;
});

答案 1 :(得分:0)

你可以绑定touchstart事件,但移动设备上没有滚动条,那么用户如何滚动?

$("body").bind("mousewheel, touchstart", function() {
     return false;
});

Demo fiddle

答案 2 :(得分:0)

我找到了这个解决方案

触摸动作:pan-x;

它允许您点击内容,但无法向下滚动

相关问题