About JS mouse event synthesis Each Big browser can get the coordinates of the properties of the total following five kinds

Source: Internet
Author: User
clientx/y:

Clientx/y gets the trigger point relative to the upper-left corner of the viewable area of the browser, and does not change with the page scrolling

Compatibility: All browsers are supported

pagex/y:

Pagex/y gets the distance from the upper-left corner of the trigger point relative to the document area, which changes as the page scrolls

Compatibility: Except IE6/7/8 not supported, the rest of the browsers support

offsetx/y:

Offsetx/y gets the upper-left corner of the DOM that is the trigger point relative to the trigger, but the upper-left datum points differ in different browsers, where the upper-left corner of the content area in IE does not include a border, and if the trigger point returns a negative value on the border, the upper-left corner of the border is the datum point in Chrome.

Compatibility: All versions of IE, Chrome,safari are perfect support, Firefox does not support

layerx/y:

Layerx/y gets the distance that the trigger point is relative to the upper-left corner of the DOM, and the value is the same as offsetx/y, which is the same as Firefox used to replace the offsetx/y, the base point is the upper-left corner of the border, but one condition is that The DOM that is triggered needs to be set to position:relative or Position:absolute, otherwise the distance from the upper-left corner of the relative HTML document area is returned

Compatibility: IE6/7/8 not supported, opera does not support, IE9/10 and Chrome, Safari support

screenx/y:

Screenx/y gets the distance of the trigger point relative to the upper-left corner of the display screen, and does not change with the page scrolling

Compatibility: All browsers are supported

About JS mouse event synthesis Each Big browser can get the coordinates of the properties of the total following five kinds

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.