Various heights and widths of Jquery documents

Source: Internet
Author: User

$ (document). Ready (function() {Alert (window). Height ());//browser window visibility area heightAlert (document). Height ());//Height of window document in browserAlert ($ (document.body). Height ());//browser window Document height of the bodyAlert ($ (document.body). Outerheight (true));//browser window document the total height of the body includes border padding marginAlert ($ (window). width ());//width of window viewable area in browserAlert (document). width ());//browser window document for image widthAlert ($ (document.body). width ());//browser window Document height of the bodyAlert ($ (document.body). Outerwidth (true));//browser window Document the total width of the body includes border padding margin}) jquery's $ (window). Height () indicates the height of the browser window; height of the browser window if the content of the document is not high enough to the height of the browser<br>However, when the content of a document point exceeds the height of the browser, its height is the height of the entire document. $ (document.body). Height () refers to the actual height of the document. 

Do not want to set the fixed, even if the body height is very small can put the bottom content to the bottom of the method:

var h=$ (document). Height ();
$ (' body '). CSS (' height ', h);

Style: position:absolute;bottom:10px;

Transferred from: http://www.cnblogs.com/java-boy/archive/2012/07/15/2592386.html

Various heights and widths of Jquery documents

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.