Javascript, jquery get the width and height method of various screens

Source: Internet
Author: User

JavaScript Gets the screen width and height method:

Document.body.clientWidth;//width of visible area of Web pageDocument.body.clientHeight;//High Visibility area of Web pageDocument.body.offsetWidth;//width of the visible area of the 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 widthDocument.body.scrollHeight;//page body Full text highDocument.body.scrollTop;//The page is being rolled out of the highDocument.body.scrollLeft;//the page is rolled away to the leftWindow.screentop;//on the body part of the pageWindow.screenleft;//page body part leftWindow.screen.height;//High Screen resolutionWindow.screen.width;//width of screen resolutionWindow.screen.availHeight;//screen available work area heightWindow.screen.availWidth;//screen available work area width

jquery Gets the screen width and height method:

$ (window). Height ();//Browser Current window viewable area height$ (document). Height ();//the height of the browser's current window document$ (document.body). Height ();//the height of the body of the browser's current window document$ (document.body). Outerheight (true);//Browser Current Window document body total height includes border padding margin$ (window). width ();//Browser Current window viewable area width$ (document). width ();//Browser Current Window Document object width$ (document.body). width ();//Browser Current Window document body width$ (document.body). Outerwidth (true);//Browser Current Window document body total width includes border padding margin

Javascript, jquery get the width and height method of various screens

Related Article

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.