Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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;
@ghost

This comment has been minimized.

Copy link

@ghost ghost commented Nov 6, 2015

+1

@msmfsd

This comment has been minimized.

Copy link

@msmfsd msmfsd commented Nov 3, 2016

👍

@rguillermo

This comment has been minimized.

Copy link

@rguillermo rguillermo commented Apr 17, 2019

(y)

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