Post:
Visible area width of the webpage: Document. Body. clientwidth
Visible area height: Document. Body. clientheight
Visible area width of the webpage: Document. Body. offsetwidth (including the width of the edge)
Visible area height of the webpage: Document. Body. offsetheight (including the width of the edge)
Webpage text width: Document. Body. scrollwidth
Webpage text height: Document. Body. scrollheight
The height of the page to be rolled: Document. Body. scrolltop (IE7 is invalid)
Left of the webpage to be rolled: Document. Body. scrollleft (IE7 is invalid)
The height of the page to be rolled: document.doc umentelement. scrolltop (valid for IE7)
Left of the page to be rolled: document.doc umentelement. scrollleft (IE7 valid)
Page body: window. screentop
Page body part 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
Original:
The W3C standard will also affect the preceding values. The following code is verified by me:
Make the following statement on the page:
<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
Values in the Code:
Document. Body. clientheight; // This is the height of the current visible area
2008/08/27 Add:
I suddenly found that this method of height is not the spirit of the general spirit, so I found another better method.
Math.max(document.doc umentelement. clientheight, document. Body. scrollheight); // This is the height of the current visible area
Document. Body. clientwidth; // This is the width of the current visible area.