Skip to content

Instantly share code, notes, and snippets.

@iamphill

iamphill/inner.js

Created Jan 22, 2014
Embed
What would you like to do?
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