jquery windows, documents, Web pages a variety of highly accurate understanding _jquery

Source: Internet
Author: User

$ (document). Height (): Height of the entire page
$ (window). Height (): Height of the browser visual window
$ (window). scrolltop (): Height of the top of the browser's visual window from the top of the page (vertical offset)

A word to understand is this: when the Web scroll bar is pulled to the lowest end, $ (document). Height () = = $ (window). Height () + $ (window). scrolltop ().

$ (document) when the page is not high enough for the browser window. Height () returns $ (window). Height ().

It is not recommended to use $ ("html"). Height (), $ ("body"). Heights ().

Reason:

$ ("body"). Height (): The body may have a border, and the height will be higher than $ (document). Height () small;
$ ("html"). Height (): The height of the different browsers to get the meaning of the difference will be, the plain is that the browser is not compatible.
$ (window). Height () value problem, not return the height of the browser window?

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.