Skip to content

Instantly share code, notes, and snippets.

@iamphill
Created January 22, 2014 11:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iamphill/8557336 to your computer and use it in GitHub Desktop.
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.
/**
* 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