1. High document height, high document area of the screen
Document.body.clientHeight
2. Effective high, high screen visibility
Document.documentElement.clientHeight
3. Total height of the screen
Document.documentElement.scrollHeight
4. The height of the scroll
Document.documentElement.scrollTop
JS Code
<Script>
Gain effective width and height, wide screen visibility
VarWinX=Document.DocumentElement.ClientWidth;
VarWiny=Document.DocumentElement.ClientHeight;
AlertWinX);
AlertWiny);
Gets the width and height of the body text area
VarWinxx=Document.Body.ClientWidth;
VarWinyy=Document.Body.ClientHeight;
AlertWINXX);
AlertWinyy);
Get the total width and height
VarWinxxx=Document.DocumentElement.ScrollWidth;
VarWinyyy=Document.DocumentElement.ScrollHeight;
AlertWINXXX);
AlertWINYYY);
Height of scrolling This method has compatibility issues
Window.Onscroll= function () {
Determine if the browser you are using is chrome
IfNavigator.UserAgent.IndexOf ("Chrome")>-1) {
For Google Chrome
VarWiny=Document.Body.ScrollTop }else{
//for IE , Firefox
var winy Span style= "color: #fbde2d;" >= document. documentelement. scrolltop
document. Title = winy };
</SCRIPT>
</HTML>
JS element is wide, the viewable area is wide, the scrolling area is wide and the height is scrolled