dejanmarkovic
12/16/2013 - 5:50 PM

Get window width and height as variables

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