Skip to content

Instantly share code, notes, and snippets.

@joshcarr
Created July 3, 2014 00:04
  • Star 40 You must be signed in to star a gist
  • Fork 9 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save joshcarr/2f861bd37c3d0df40b30 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;
Copy link

ghost commented Nov 6, 2015

+1

@msmfsd
Copy link

msmfsd commented Nov 3, 2016

👍

@rguillermo
Copy link

(y)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment