开发者

How to calculate height and width of inner browser without including browser menu bar using jquery

I want to calculate height and width of inner body of browser 开发者_Go百科including browser scroll bar but without including browser menu toolbars using jquery. After calculating height and width i want to set some header, body and footer. Also when I re size(expand and minimize) outside and inside scroll appears which keeps my header, body, and footer fixed.

So what do I have to do in order to make it work cross-browser?


It sounds like you're trying to manually position your header and footer based on the size of the window. Why not use CSS to just position: fixed or position: absolute to let the browser position it for you?

This will position header and footer at top and bottom of your document.

#header {
    position: absolute;
    top: 0;
}
#footer {
    position: absolute;
    bottom: 0;
}

Or, this will position at top and bottom of the window:

#header {
    position: fixed;
    top: 0;
}
#footer {
    position: fixed;
    bottom: 0;
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜