Js control pulley slide instance, js pulley slide instance

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.