Created
September 6, 2011 15:41
-
-
Save eriwen/1197912 to your computer and use it in GitHub Desktop.
Get viewport dimensions for all browsers
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
function getViewportSize() { | |
var windowWidth = document.documentElement.clientWidth || document.body.clientWidth; | |
var windowHeight = document.documentElement.clientHeight || document.body.clientHeight; | |
return [windowWidth, windowHeight]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment