Gets the height of the web screen visible area

Source: Internet
Author: User

Gets the height and width of the viewable area of the browser window, and the height of the scroll bar.

Document.body.clientWidth ==>Body Object Width document.body.clientHeight==>Body Object Height document.documentElement.clientWidth==>Visible area width document.documentElement.clientHeight==>visible Area Height document.body.clientWidth==>Web page Visible area width document.body.clientHeight==>Web page Visible Area high Document.body.offsetWidth==>width of the visible area of the Web page (including the width of the edge) Document.body.offsetHeight==>High Visibility area of the Web page (including high edges) Document.body.scrollWidth==> page Body Full text width document.body.scrollHeight ==>page body Full text high Document.body.scrollTop==>The page was rolled off the high document.body.scrollLeft==>the page was rolled away to the left Window.screentop==>page body part on Window.screenleft==>page body part left Window.screen.height==>High window.screen.width of screen resolution==>screen available work area height Window.screen.availHeight==>screen available work area height Window.screen.availWidth==> screen available Work area width

The method of obtaining jquery function

$ (window). Height ()//browser window visibility area height$ (document). Height ()//Height of window document in browser$ (document.body). Height ()//browser window Document height of the body$ (document.body). Outerheight (true)//browser window document the total height of the body includes border padding margin$ (window). Width ()//width of window viewable area in browser$ (document). Width ()//browser window document for image width$ (document.body). Width ()//browser window Document height of the body$ (document.body). Outerwidth (true)//browser window Document the total width of the body includes border paddingAlert (document). ScrollTop ());//gets the vertical height of the scroll bar to the topAlert (document). ScrollLeft ());//gets the vertical width of the scroll bar to the left
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 object relative to the canvas or by the The OffsetParent property specifies the parent coordinate of the computed left position   OffsetTop:  Gets the calculated top position of the object relative to the layout or the parent coordinate specified by the OffsetTop property   Event.clientx The horizontal coordinates of the relative document   event.clienty Vertical   coordinates   of relative documents Event.offsetx relative to the horizontal coordinates of the container event.offsety relative to the container DOCUMENT.DOCUMENTELEMENT.SCROLLTOP vertical Scroll values   event.clientx+document.documentelement.scrolltop Horizontal coordinates relative to the document + The amount of scrolling in the vertical direction

Gets the height of the web screen visible area

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.