Web screen width, height, availwidth, availheight properties

Source: Internet
Author: User

*screen.width

Function: The width of the screen in which the browser is displayed is declared, in pixels.

Syntax:screen.width

*screen.height

Function: The available width of the screen that shows the browser is declared, measured in pixels.

Syntax:screen.availwidth

*screen.availwidth

Function: The available width of the screen that shows the browser is declared, measured in pixels.

Syntax:screen.availwidth

*screen.availheight

Function: Declares the available height of the screen that displays the browser, in pixels. This available height does not include vertical space assigned to semi-permanent features (such as the taskbar at the bottom of the screen).

Syntax:screen.availheight

* Example 1

Gets the width, height, available width, and available height of the browser.

<script type= "Text/javascript" > document.write ("screen width:" +screen.width+ "px<br/>");document.write ("screen height:" +screen.height+ "px<br/>");document.write ("Screen available width:" +screen.availwidth+ "px<br/>");document.write ("Screen available height:" +screen.availheight+ "px");</script>

The effect of this code is:

Screen width: 1440px
Screen Height: 900px
Screen usable width: 1440px
Screen available Height: 870px * MoreWeb page Visible area width: document.body.clientWidth
Web page Visible Area height: document.body.clientHeight
Web page Visible Area width: document.body.offsetWidth (including edge width)
Web page Visible Area High: document.body.offsetHeight (including edge height)
Page body Full text width: document.body.scrollWidth
Page body Full text High: Document.body.scrollHeight
Page is rolled away High: document.body.scrollTop
Webpage is rolled away left: document.body.scrollLeft
Page body part: Window.screentop
Page body part left: Window.screenleft
High screen resolution: Window.screen.height
Width of screen resolution: Window.screen.width
Screen available work area height: window.screen.availHeight
Screen available work area width: window.screen.availWidth

Web screen width, height, availwidth, availheight properties

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.