Created
April 28, 2014 15:35
-
-
Save omniosi/11375644 to your computer and use it in GitHub Desktop.
cross browser code to get the browser window width and height
This file contains hidden or 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 = w.innerWidth || e.clientWidth || g.clientWidth, | |
y = w.innerHeight|| e.clientHeight|| g.clientHeight; | |
console.log("browser width = "+x); | |
console.log("browser height = "+y); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment