Created
March 16, 2018 12:29
-
-
Save jeremyHixon/17ad188eaad9cff15a80d2945636e5c8 to your computer and use it in GitHub Desktop.
Accurate viewport measurements
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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