jquery window, document various heights of understanding
Last Update:2014-07-02
Source: Internet
Author: User
<span id="Label3"></p><p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; font-size:14px; font-family:Arial; color:rgb(54,46,43); line-height:26px"><p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; font-size:14px; font-family:Arial; color:rgb(54,46,43); line-height:26px">$ (document). Height (): the width of the entire Web page</p></p><p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; font-size:14px; font-family:Arial; color:rgb(54,46,43); line-height:26px"><p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; font-size:14px; font-family:Arial; color:rgb(54,46,43); line-height:26px">$ (window). Height (): width of the browser's visible window</p></p><p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; font-size:14px; font-family:Arial; color:rgb(54,46,43); line-height:26px"><p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; font-size:14px; font-family:Arial; color:rgb(54,46,43); line-height:26px">$ (window). scrolltop (): The height of the top of the browser visible window (vertical Offset) from the top of the page</p></p><p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; font-size:14px; font-family:Arial; color:rgb(54,46,43); line-height:26px"><p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; font-size:14px; font-family:Arial; color:rgb(54,46,43); line-height:26px"></p></p><p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; font-size:14px; font-family:Arial; color:rgb(54,46,43); line-height:26px"><p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; font-size:14px; font-family:Arial; color:rgb(54,46,43); line-height:26px">In a word, it is: $ (document) when the page scroll bar is pulled to the lowest end. height () = = $ (window). Height () + $ (window). scrolltop ().</p></p><p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; font-size:14px; font-family:Arial; color:rgb(54,46,43); line-height:26px"><p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; font-size:14px; font-family:Arial; color:rgb(54,46,43); line-height:26px"></p></p><p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; font-size:14px; font-family:Arial; color:rgb(54,46,43); line-height:26px"><p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; font-size:14px; font-family:Arial; color:rgb(54,46,43); line-height:26px">$ (document) When the page height is less than the browser window. height () returns a $ (window). height ().</p></p><p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; font-size:14px; font-family:Arial; color:rgb(54,46,43); line-height:26px"><p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; font-size:14px; font-family:Arial; color:rgb(54,46,43); line-height:26px"></p></p><p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; font-size:14px; font-family:Arial; color:rgb(54,46,43); line-height:26px"><p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; font-size:14px; font-family:Arial; color:rgb(54,46,43); line-height:26px">It is not recommended to use $ ("html"). height (), $ ("body").</p></p><p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; font-size:14px; font-family:Arial; color:rgb(54,46,43); line-height:26px"><p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; font-size:14px; font-family:Arial; color:rgb(54,46,43); line-height:26px">Reason:</p></p><p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; font-size:14px; font-family:Arial; color:rgb(54,46,43); line-height:26px"><p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; font-size:14px; font-family:Arial; color:rgb(54,46,43); line-height:26px">$ ("body"). Height (): body may have a border that gets a higher height than $ (document). height () small;</p></p><p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; font-size:14px; font-family:Arial; color:rgb(54,46,43); line-height:26px"><p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; font-size:14px; font-family:Arial; color:rgb(54,46,43); line-height:26px">$ ("html"). Height (): The meanings of the heights obtained on different browsers will vary, and the browser is not Compatible.</p></p><p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; font-size:14px; font-family:Arial; color:rgb(54,46,43); line-height:26px"><p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; font-size:14px; font-family:Arial; color:rgb(54,46,43); line-height:26px"></p></p><p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; font-size:14px; font-family:Arial; color:rgb(54,46,43); line-height:26px"><p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; font-size:14px; font-family:Arial; color:rgb(54,46,43); line-height:26px">the <strong>$ (window). Height () value</strong> is not the height of the browser window returned?</p></p><p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; font-size:14px; font-family:Arial; color:rgb(54,46,43); line-height:26px"><p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; font-size:14px; font-family:Arial; color:rgb(54,46,43); line-height:26px"><br></p></p><p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; font-size:14px; font-family:Arial; color:rgb(54,46,43); line-height:26px"><p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; font-size:14px; font-family:Arial; color:rgb(54,46,43); line-height:26px"><br></p></p><p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; font-size:14px; font-family:Arial; color:rgb(54,46,43); line-height:26px"><p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; font-size:14px; font-family:Arial; color:rgb(54,46,43); line-height:26px">This post is my Baidu blog move, Baidu blog Address: http://hi.baidu.com/confidence68/item/79ff67178126f54a6826bb61</p></p><p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; font-size:14px; font-family:Arial; color:rgb(54,46,43); line-height:26px"><p style="margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; font-size:14px; font-family:Arial; color:rgb(54,46,43); line-height:26px"><br></p></p></span>