HTML document, documentElement , body 各对象.

document              // Html 的容器对象.

document.documentElement      //html 对象

document.body            // body 对象

$(document.documentElement).find("body") ;    // Body 对象.

各个高度有各个高度的含义.

document >  document.documentElement > body .

但是 document.height  却很小.

试验:

  <div style="margin: 1px 2px 3px 4px; padding: 5px 6px 7px 8px; border-top: 9px solid pink;
        border-right: 10px solid pink; border-bottom: 11px solid pink; border-left: 12px solid pink;
        background-color: green; height: 300px;">
        <div style="height: 25px;background-color:Blue;">
        </div>
        <div class="FillHeight" style="margin: 13px 14px 15px 16px; padding: 17px 18px 19px 20px;
            border-top: 21px solid pink; border-right: 22px solid pink; border-bottom: 23px solid pink;
            border-left: 24px solid pink; background-color: Yellow;">
            <asp:ContentPlaceHolder ID="MainContent" runat="server">
            </asp:ContentPlaceHolder>
        </div>
    </div>

Height 就是 内容部分的高度.

outerHeight =  Heigth + Border + Padding .

Offset 是按 outerHeight  的位置来计算的. 即= 边框左上角 的 Offset .

容器A

容器内要计算的对象B

B高 = A 高- B.Offset().top - B.marginBottom - B.Border - B.Padding 


posted @ 2011-05-13 13:12  NewSea  阅读(2074)  评论(0编辑  收藏  举报