$ (Document). height (), $ ("body"). height (), $ (window). height () Differences and links, document. height
The height is used as an example here, and the width problem is similar. During mobile development, a piece of content is often located at the bottom. When the page content is less than one screen, it needs to be set to fixed, but more than one screen, it must be set to static at the top of the page to the bottom. In this case, you need to judge $ (document ). height () and $ (window ). height () is used to identify whether the content is ultra-screen.
$ (Document): entire document
$ ("Body"): body
$ (Window): the view (with doctype enabled)
1) when the page content is greater than the browser window: $ (document ). height () = $ ("body "). height ()> $ (window ). height ();
2) When the page content is smaller than the window: $ (document). height () = $ (window). height () >$ ("body"). height ();
In addition, $ (window). height () is also affected by the DOCTYPE of the page header. By default, it is the premise that DOCTYPE is available.