Js control pulley slide instance, js pulley slide instance
Today, I got something. The page was originally horizontal, so there was a horizontal scroll bar at the bottom, and there was no scroll bar at the vertical bar. Now it is required that the mouse pulley be rolled left and right, this requires writing js Code to implement it. It is very troublesome to write 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:
<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
This code is actually a problem. In chrome, only the mouse is placed in the gray area to slide. I have never solved this problem. If that problem is solved, I can leave a message and tell me, thank you.