Skip to content

Instantly share code, notes, and snippets.

@FrankFonts
Created May 25, 2022 11:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FrankFonts/fc59c5e5b540ff40e2d7827b04b4bdc6 to your computer and use it in GitHub Desktop.
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)
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