开发者

How to find the browser height including the toolbars and buttons with javascript?

开发者 https://www.devze.com 2023-03-11 21:36 出处:网络
Is there a way to find the browser height with the toolbars and buttons of the开发者_Python百科 browser, not only the window or document height?For the size of the viewport, you use window.innerWidth

Is there a way to find the browser height with the toolbars and buttons of the开发者_Python百科 browser, not only the window or document height?


For the size of the viewport, you use window.innerWidth and window.innerHeight. For the whole window, including decorations, use window.outerWidth and window.outerHeight. Then, all you need to do is subtract one from the other.

Edit: There is no supported way of doing this in IE8 and older. This is explained in this article and also provides a workaround which involves resizing the browser window. There is also this Stack Overflow answer.

0

精彩评论

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