Skip to content

Instantly share code, notes, and snippets.

@jeremyHixon
Created March 16, 2018 12:29
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 jeremyHixon/17ad188eaad9cff15a80d2945636e5c8 to your computer and use it in GitHub Desktop.
Save jeremyHixon/17ad188eaad9cff15a80d2945636e5c8 to your computer and use it in GitHub Desktop.
Accurate viewport measurements
var w = window,
d = document,
e = d.documentElement,
g = d.getElementsByTagName('body')[0],
x, y;
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