开发者

How to get max possible client width

Web page should adapt be adapted to maximal possible size of brow开发者_如何学Goser's window, that user can have.

Is there a way to get maximal possible size of browser's viewport ?

I feel, that it's not so simple, as might be, because user can show or hide some toolbars in browser, that will affect the viewport size.

Is this even possible ?


function getWidth() { var pagewidth=document.body.clientWidth; // Whatever you want to do with it. }

Sould do it.


Why don't you use a fluid layout while designing in css. Read about it. Setting dimensions of DOM elements using percentages will help you achieve this. It will scale automatically according to the client browser size.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜