参考以下示例:
http://css-tricks.com/snippets/jquery/horz-scroll-with-mouse-wheel/
在Chrome下它是有效的,但在Firefox下却无效。
在Firefox中,您只能使用箭头键而不是鼠标滚轮进行滚动。
有人知道为什么会发生这种情况吗?
参考以下示例:
http://css-tricks.com/snippets/jquery/horz-scroll-with-mouse-wheel/
在Chrome下它是有效的,但在Firefox下却无效。
在Firefox中,您只能使用箭头键而不是鼠标滚轮进行滚动。
有人知道为什么会发生这种情况吗?
$(function() {
$("html, body, *").mousewheel(function(event, delta) {
this.scrollLeft -= (delta * 80);
this.scrollRight -= (delta * 80);
event.preventDefault();
});
});
以下是在您提供的网站评论中发布的解决方案:
$(function() {
$("html, body").mousewheel(function(event, delta) {
this.scrollLeft -= (delta * 30);
event.preventDefault();
});
});