简体   繁体   中英

How to get the max-innerHeight when browser is not 100% (size)

Suppose window.innerHeight = 978px when the browser is 100% (not full screen).

However, when resizing the browser, window.innerHeight value will decrease.

So how to get the height = 978px when when the browser is not 100%? (I want to get this to calculate something in js script)

Update

I have an idea how to get this, the script should be

window.screen.availHeight - window.outerHeight + window.innerHeight

But, for Safari, the script should be

window.screen.availHeight - window.outerHeight + window.innerHeight - 3

You maybe need to look for:

screen.height

The issue is I'm not sure you can use get the height of the start-bar (assuming it's windows and on the bottom). Otherwise this will probably be a good starting point.

https://www.w3schools.com/js/js_window_screen.asp

Try this:

document.documentElement.clientHeight

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM