Clientheight, offsetheight, scrollheight, clientwidth, offsetwidth, and scrollwidth

Source: Internet
Author: User

Visible area width of the webpage: Document. Body. clientwidth
Visible area height: Document. Body. clientheight
Visible area width of the webpage: Document. Body. offsetwidth
Visible area height: Document. Body. offsetheight
Webpage text width: Document. Body. scrollwidth
Webpage text height: Document. Body. scrollheight
Page size: window. screentop
Page to the left: window. screenleft
Screen Resolution Height: window. Screen. Height
Screen Resolution width: window. Screen. Width
Available screen workspace Height: window. Screen. availheight
Available workspace width: window. Screen. availwidth

Clientwidth, clientheight
There is no objection to clientheight, and they all regard it as 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.

Offsetwidth, 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.

Scrollwidth, 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.

Window. screentop, window. screenleft

Window. Screen. Height, window. Screen. Width

Window. Screen. availheight, window. Screen. availwidth

Clientheight is the height of the area where the content is viewed through the browser.
NS and FF hold that both offsetheight and scrollheight are the content height of the webpage. However, when the content height of the webpage is less than or equal to clientheight, the value of scrollheight is clientheight, while the value of offsetheight can be less than clientheight.
IE and opera hold that offsetheight is the clientheight scroll bar and border in the visible area. Scrollheight indicates the actual height of the webpage content.

Likewise
The description of clientwidth, offsetwidth, and scrollwidth is the same as above. You only need to change the height to the width.

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.