Skip to content

Instantly share code, notes, and snippets.

@dejanmarkovic
Created December 16, 2013 17:50
Show Gist options
  • Save dejanmarkovic/7991222 to your computer and use it in GitHub Desktop.
Save dejanmarkovic/7991222 to your computer and use it in GitHub Desktop.
Get window width and height as variables
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;
Source: http://andylangton.co.uk/blog/development/get-viewport-size-width-and-height-javascript
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment