Convert _ layerx

Source: Internet
Author: User


Screenx: coordinates of the mouse on the screen.

Clientx: coordinates of the area displayed by the mouse on the page.

Note: The above two are common to all browsers.

Pagex: FF is unique. The cursor position on the page is located from the upper left corner of the page. This can be easily located on the entire page. ie has no direct replacement attribute.

Layerx: FF exclusive. The cursor is the position of the boundary of "parent element of position" relative to the "closest to this element in the hierarchy of elements that trigger the event, locate from the upper left corner of border, that is, if the parent element is saved
In border, the coordinate origin is in the upper left corner of border, rather than the upper left corner of the content area.

Offsetx: exclusive to ie. the cursor is located from the upper left corner of the content area, not from the upper left corner of border, relative to the position of the trigger event element! This attribute is easy to use and is used to determine where the mouse points are in an element. FF does not directly replace the attribute.

X: exclusive to IE, which has the same effect as layerx and can be directly replaced by layerx.

Note: There is a 1px difference between IE and FF positioning. In fact, ie positioning starts from 0, FF positioning starts from 1, and FF is always 1px larger than IE positioning, it must be handled according to the actual situation.

Offsetleft: This attribute is not the property of the event object, but belongs to the DOM object. This attribute indicates that the DOM object is closest to the object in the hierarchical relationship of the DOM object, the position in "parent object" is set. Although this is the case, different browsers have different effects. FF strictly follows the preceding instructions, but in IE6/7, this attribute returns the position of the DOM object in its direct parent object, but IE8 corrected this problem, but IE8 encountered a new problem, other browsers are located from the upper left corner of the content area of the parent object. IE8 is located from the upper left corner of the border of the parent element. Because the test environment is IE8 in ietester, The ietester issue cannot be ruled out.

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: 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.