Clientx, clienty, offsetx, offsety, screenx, screeny, X, Y, clientheight, offsetheight, scrollheight

Source: Internet
Author: User

What are the differences between clientx, clienty, offsetx, offsety, screenx, screeny, X, and Y?

Clientx, clienty is the current position of the mouse relative to the webpage. When the mouse is in the upper left corner of the page, clientx = 0 and clienty = 0;

Offsetx and offsety are the positions of the current mouse relative to a certain area in the webpage. When the mouse is located in the upper left corner of the area in the page, offsetx = 0 and offsety = 0;

Screenx, screeny is the position X relative to the user's display, and Y is the position of the current mouse relative to the current Browser

 

Clientheight

Everyone has no objection to clientheight and thinks it is the height of the visible area of the content, that is, the height of the area where the content can be viewed in the browser of the page, generally, the area below the last toolbar to above the status bar is irrelevant to the page content.

 

Offsetheight

  • IE and opera think offsetheight = clientheight + scroll bar + border.
  • NS and FF hold that offsetheight is the actual height of the webpage content, which can be smaller than clientheight. That is to say, when the actual height of the webpage content is less than clientheight, offsetheight returns the actual height of the webpage content.

Scrollheight

  • IE and opera hold that scrollheight is the actual height of the webpage content, which can be smaller than clientheight.
  • NS and FF think that scrollheight is the height of the webpage content, but the minimum value is clientheight. That is to say, when the actual height of the webpage content is smaller than clientheight, scrollheight returns clientheight.

 

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.