When working on a project today, use the ' horizontal scroll bar to move through the scroll wheel '
Got a lot of information on the Internet.
Also found some plug-ins! It's not very useful.
And I probably checked the information myself.
To find a presumably more reliable
Html
<style= "width:5000px;" >Test</div>
Jquery
$(function() { //sets the length of each scroll, per px varScroll_width = 100; varscroll_events = "MouseWheel dommousescroll mozmousepixelscroll"; $ (document). On (Scroll_events,function(e) {varDelta = E.originalevent.wheeldelta | |E.originalevent.detail; //the pulley scrolls down, the scroll bar moves to the right, scrollleft+ if(Delta > 0) { $("HTML"). ScrollLeft ($ ("html"). ScrollLeft () +scroll_width); } //The pulley rolls upward, the scroll bar moves toward the seat, scrollleft- Else { $("HTML"). ScrollLeft ($ ("html"). ScrollLeft ()-scroll_width); } });});
Javascript
Window.onload =function() { //Monitor mouse wheel varMousewheelevt = (/firefox/i.test (navigator.useragent))? "Dommousescroll": "MouseWheel"; if(document.attachevent) {document.attachevent ("On" + mousewheelevt,function(e) {mousewheel_event (E.wheeldelta); }); } Else if(Document.addeventlistener) {Document.addeventlistener (mousewheelevt,function(e) {mousewheel_event (e.detail); }, false); } //sets the length of each scroll, per px varScroll_width = 100; functionmousewheel_event (delta) {//the pulley scrolls down, the scroll bar moves to the right, scrollleft+ if(Delta > 0) {document.getElementsByTagName ("HTML") [0].scrollleft+=Scroll_width; } //The pulley rolls upward, the scroll bar moves toward the seat, scrollleft- Else{document.getelementsbytagname ("HTML") [0].scrollleft-=Scroll_width; } }};
Reference: Http://zhidao.baidu.com/link?url= Yp2gvssadxq1t2dox5idha0xdel5k7rssiffclgg9dmxsjrxtdklldwresxvo8uok1yrquyvou9p-ssorpc2f_
jquery method I tried it. Found in IE OK under chrome does not perform properly
I looked for the next reason.
Discover Chrome under
$ ("HTML"). ScrollLeft ()
Forever is 0
In the domestic find no solution to go
http://stackoverflow.com/found it. Keywords: Chrome scrollleft
Sure enough to find an article
Http://stackoverflow.com/questions/13927430/html-scrollleftvalue-not-working-in-chrome
It turns out that Chrome doesn't work
$ ("HTML"). ScrollLeft () and requires $ (window). scrollleft (100);
Horizontal scroll bars are moved and problem-handled according to the scrolling of the rollers