Width of the visible area of the Web page: document.body.clientWidth
Height of the visible area of the Web page: document.body.clientHeight
Width of the visible area of the page: Document.body.offsetWidth (including the width of the edge)
Height of the visible area of the page: Document.body.offsetHeight (including the height of the edge)
Width of the full text of the Web page: document.body.scrollHeight
Page body Full text height: document.body.scrollWidth
Page is rolled away High: document.body.scrollTop
Webpage is rolled away left: document.body.scrollLeft
Page body part: Window.screentop
Webpage body part do: window.scrollleft
High screen resolution: Window.screen.height
Width of screen resolution: Window.screen.width
Height of the available workspace for the screen: window.screen.availHeight
Width of the available workspaces for the screen: window.screen.availWidth
functionGetInfo () {vars = ""; S+ = "page visible area width:" +Document.body.clientWidth; S+ = "page visible Area High:" +Document.body.clientHeight; S+ = "page visible area width:" + document.body.offsetWidth + "(including Edge and scroll bar width)"; S+ = "page visible Area High:" + Document.body.offsetHeight + "(including edge width)"; S+ = "Page body Full text width:" +Document.body.scrollWidth; S+ = "page body full text High:" +Document.body.scrollHeight; S+ = "page is rolled high (FF):" +Document.body.scrollTop; S+ = "page is rolled high (ie):" +Document.documentElement.scrollTop; S+ = "page is rolled away left:" +Document.body.scrollLeft; S+ = "Page body part:" +Window.screentop; S+ = "Page body part left:" +Window.screenleft; S+ = "High screen resolution:" +Window.screen.height; S+ = "width of screen resolution:" +Window.screen.width; S+ = "screen usable workspace height:" +Window.screen.availHeight; S+ = "Screen available work area width:" +Window.screen.availWidth; S+ = "Your screen settings are" + window.screen.colorDepth + "bit color"; S+ = "Your screen settings" + Window.screen.deviceXDPI + "pixels/inch"; Console.log (s); } getInfo ();
Get page height in JavaScript (knowledge point)