问题与水平轮滚动 [英] issue with horizontal wheel scroll
本文介绍了问题与水平轮滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个模板,当用户使用鼠标滚轮模板水平滚动。
是否有任何方法在Firefox和IE浏览器水平滚动?
/ p>这里是一个演示: http://jsfiddle.net/VhERd /
和jquery:
< script> ;
$(function(){
$(body)。mousewheel(function(event,delta){
this.scrollLeft - = 30);
event.preventDefault();
});
});
< / script>
< script src =http://css-tricks.com/examples/HorzScrolling/jquery.mousewheel.js>< / script>
和结尾sry for my english;)
解决方案
它需要解决 html
元素,而不是正文
元素。
$(body,html)。mousewheel ....
I have a template that when user use mouse wheel the template scroll horizontally .
but it just work in chrome .
is there any way to scroll horizontally in firefox and IE ?
here is a demo : http://jsfiddle.net/VhERd/
and jquery :
<script>
$(function() {
$("body").mousewheel(function(event, delta) {
this.scrollLeft -= (delta * 30);
event.preventDefault();
});
});
</script>
<script src="http://css-tricks.com/examples/HorzScrolling/jquery.mousewheel.js"></script>
and at the end sry for my english ;)
解决方案
It needs to work off the html
element, not body
element for Firefox.
$("body, html").mousewheel....
这篇关于问题与水平轮滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文