Is there a way to find the browser height with the toolbars and buttons of the browser, not only the window or document height?
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- void before promise syntax
- Keeping track of variable instances
- Can php detect if javascript is on or not?
For the size of the viewport, you use
window.innerWidth
andwindow.innerHeight
. For the whole window, including decorations, usewindow.outerWidth
andwindow.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.