Created
May 25, 2022 11:41
-
-
Save FrankFonts/fc59c5e5b540ff40e2d7827b04b4bdc6 to your computer and use it in GitHub Desktop.
Best way to query the REAL window width and height (scrollbars included if there is any)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let width = window.innerWidth | |
|| document.documentElement.clientWidth | |
|| document.body.clientWidth; | |
let height = window.innerHeight | |
|| document.documentElement.clientHeight | |
|| document.body.clientHeight; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment