Created
January 22, 2014 11:43
-
-
Save iamphill/8557336 to your computer and use it in GitHub Desktop.
IE8 doesn't have window.innerWidth or window.innerHeight So here is two functions to help with that.
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
/** | |
* Get window width | |
**/ | |
var getWindowWidth = function() { | |
return window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; | |
}; | |
/** | |
* Get window height | |
**/ | |
var getWindowHeight = function() { | |
return window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment