I wrote a simple JavaScript program and found that the window.innerHeight
is equal to the scroll bar height. Is window.innerHeight
just equal to the scroll bar height? If that's the case, how does one get the actual window height?
Asked
Active
Viewed 132 times
0

Yi Xiang Chong
- 744
- 11
- 9
-
2That is the actual height of the window, i.e. the viewport: https://developer.mozilla.org/en-US/docs/Web/API/Window/innerHeight . If you want to get the height of the content, you can use [`scrollHeight`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollHeight) of `body` or `html` element. – Teemu Apr 29 '20 at 06:39
-
1You can find the answer here: [Get the size of the screen, current web page and browser window](https://stackoverflow.com/questions/3437786/get-the-size-of-the-screen-current-web-page-and-browser-window) – 54ka Apr 29 '20 at 06:48