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.