On mobile (e.g. Chrome on Android) the viewport height changes depending on whether the URL/Address bar is hidden or not, which changes depending on whether you're scrolling up or down on the page.
Given this, I need 2 variables:
- Viewport height if URL bar were showing (regardless of actual state).
- Viewport height if URL bar were not showing (regardless of actual state).
In other words: "min" and "max" viewport heights. How would I go about doing that? I only know how to get:
- Viewport height given current state of URL bar (showing/not-showing).
By doing: Math.max(document.documentElement.clientHeight, window.innerHeight || 0)
(source: https://stackoverflow.com/a/8876069/473368).