This article mainly introduces the Js control pulley slide between the left and right instances. This article provides the implementation code directly. If you need a friend, you can refer to today to get something. The page is originally horizontal, so there is a horizontal scroll bar at the bottom, and there will be no scroll bar when it is vertical. Now it is required that the mouse pulley should be rolled left and right, which requires js Code to be written. This is a great deal of trouble in the process of writing this code.
The functions supported by ie Firefox chrome are completely different.
Here are some knowledge points to explain
Monitor pulley events
Ie: onmousewheel
Firfox: DOMMouseScroll
Chrome: mousewheel
Ah, it's speechless.
The return values of scrolling are also different.
Firfox returns +-3 with detail
Others return +-120 using wheelDelta
Returns a value to determine the direction of scrolling.
In addition to the Left Movement of the Chrome browser page, the general browser also uses document.doc umentElement. scrollLeft
However, chrome uses document. body. scrollLeft
The Code is as follows:
Untitled document