JS get browser height and width values (multi-browser)

Source: Internet
Author: User

ie: document.body.clientWidth ==> body Object width document.body.clientHeight ==> Body Object Height Document.documentElement.clientWidth ==> Visible Area width document.documentElement.clientHeight ==> visible area height in Firefox: Document.body.clientWidth ==> Body Object width document.body.clientHeight ==> Body Object Height Document.documentElement.clientWidth ==> Visible Area width document.documentElement.clientHeight ==> visible area height in opera: Document.body.clientWidth ==> Visible Area width document.body.clientHeight ==> visible area height Document.documentElement.clientWidth ==> Page object width (i.e. body object width plus margin) Document.documentElement.clientHeight = = > Page Object height (that is, body object height plus margin) there is no standard to define the Web, ie: document.documentElement.clientWidth ==> 0 Document.documentElement.clientHeight ==> 0 Firefox: document.documentElement.clientWidth ==> The width of the page object (that is, the body object width plus the margin width) document.documentElement.clientHeight ==> The height of the page object (that is, the body object height plus the margin) opera is: Document.documentElement.clientWidth ==> The width of the page object (that is, the body object width plus the margin width) document.documentElement.clientHeiGht ==> Page Object height (that is, body object height plus margin) web page visible area width: document.body.clientWidth The visible area of the page is high: document.body.clientHeight the width of the visible area of the Web page: Document.body.offsetWidth (including edge width) web page visible Area High: document.body.offsetHeight (including high edges) page body Full text width: document.body.scrollWidth Page body Full text High: Document.body.scrollHeight Web page is rolled High: Document.body.scrollTop page is rolled left: Document.body.scrollLeft page body part: Window.screentop page body part left: Window.screenleft screen resolution High: window.screen.height width of screen resolution: Window.screen.width Screen available Workspace height: Window.screen.availHeight screen Usable workspace width: window.screen.availWidth html precise positioning: Scrollleft,scrollwidth,clientwidth, Offsetwidth scrollheight: Gets the scroll height of the object. ScrollLeft: Sets or gets the distance between the left edge of the object and the leftmost of the currently visible content in the window scrolltop: Sets or gets the distance between the top of the object and the top of the visible content in the window ScrollWidth: Gets the scroll width of the object Offsetheight: Gets the height of the object relative to the layout or the parent coordinate specified by the parent coordinate OffsetParent property offsetleft: Gets the left position of the object relative to the layout or the parent coordinate specified by the OffsetParent property OffsetTop: Gets the computed top position of the object relative to the layout or the parent coordinate specified by the OffsetTop property Event.clientx relative to the horizontal coordinates of the document Event.clienty relative to the horizontal coordinate of the document EVENT.OFFSETX relative to the container Event.offsety the vertical coordinate of the relative container document.documentElement.scrollTop the value of scrolling verticallyEvent.clientx+document.documentelement.scrolltop horizontal coordinates of relative documents + amount of vertical scrolling  

  

JS get browser height and width values (multi-browser)

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.