Last active
August 29, 2015 14:01
-
-
Save idettman/68d66c937fa947a0e06b to your computer and use it in GitHub Desktop.
Javascript function to get browser window dimensions
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
function getWindowSize() { | |
if (window.innerWidth || window.innerHeight) { | |
return [window.innerWidth,window.innerHeight]; | |
} | |
else { | |
return [(document.documentElement.clientWidth||document.body.clientWidth||document.body.scrollWidth),(document.documentElement.clientHeight||document.body.clientHeight||document.body.scrollHeight)]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment