Get page height in JavaScript (knowledge point)

Source: Internet
Author: User

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)

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.