Jquery+js get browser height and width

Source: Internet
Author: User

-------------------------------------------------JS---------------------------------------------------------------

Web page Visible area width: document.body.clientwidth** Web page Visible Area High: document.body.clientheight** Web page Visible area width: document.body.offsetWidth ( Include edge width) * * Web page Visible Area High: document.body.offsetHeight (including edge width) * * 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 away left: document.body.scrollleft** Page body part: window.screentop** page body part left: window.screenleft** screen resolution: window.screen.height** Width of screen resolution: Window.screen.width * * Screen available workspace height: window.screen.availheight** screen available work area width: Window.screen.availWidthHTML 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 scrolling 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 calculated object relative to the layout or the parent coordinate specified by the OffsetParent property * * OffsetTop: Gets the calculated 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 the vertical coordinates of the relative document **event.offsetx The horizontal coordinate of the relative container **event.offsety the value of the vertical direction of the container relative to the vertical **document.documentelement.scrolltop **EVENT.CLIENTX+DOCUMENT.DOCUMentelement.scrolltop the Ie,firefox difference between the horizontal coordinates of the relative document and the vertical direction of scrolling is as follows: IE6.0, ff1.06+:clientwidth = width + paddingclientheight = Height + paddingoffsetwidth = width + padding + borderoffsetheight = height + padding + borderie5.0/5.5:**clientwidth = wi Dth-borderclientheight = Height-borderoffsetwidth = Widthoffsetheight = height (need to mention: Margin property in CSS, with ClientWidth, Offsetwidth, clientheight, offsetheight are irrelevant)

 

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.