Skip to content

Instantly share code, notes, and snippets.

@MrAndrewMal
Forked from joshcarr/window-height-width.js
Created June 7, 2020 20:56
Show Gist options
  • Save MrAndrewMal/2b2c78191c3c327cf25f84f2e9986743 to your computer and use it in GitHub Desktop.
Save MrAndrewMal/2b2c78191c3c327cf25f84f2e9986743 to your computer and use it in GitHub Desktop.
vanilla JS window width and height
// vanilla JS window width and height
var w=window,
d=document,
e=d.documentElement,
g=d.getElementsByTagName('body')[0],
x=w.innerWidth||e.clientWidth||g.clientWidth,
y=w.innerHeight||e.clientHeight||g.clientHeight;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment