Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@graphicagenda
Forked from joshcarr/window-height-width.js
Last active November 29, 2019 22:54
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 graphicagenda/8e46a034f7bc2ef669b5bac6e5207f3e to your computer and use it in GitHub Desktop.
Save graphicagenda/8e46a034f7bc2ef669b5bac6e5207f3e to your computer and use it in GitHub Desktop.
[vanilla JS window width and height] #unlabeled
// 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