JS or jquery Gets the various heights of the current screen

Source: Internet
Author: User
Keywords js or jquery current screen width css js height

Javascript:

Web 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


Jquery:


$(document).ready(function(){
Alert($(window).height()); //The height of the current viewport of the browser
Alert($(document).height()); //The height of the browser's current window document
Alert($(document.body).height());//The height of the browser's current window document body
Alert($(document.body).outerHeight(true));//The total height of the body of the current window of the browser, including the border padding margin

Alert($(window).width()); //The current window visible area width of the browser
Alert($(document).width());//Browser current window document object width
Alert($(document.body).width());//Browser current window document body width
Alert($(document.body).outerWidth(true));//The total width of the body of the current window of the browser, including the border padding margin
})



JS or jquery Gets the various heights of the current screen

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.