Skip to content

Instantly share code, notes, and snippets.

@CyrilKrylatov
Last active December 12, 2015 02:59
Show Gist options
  • Save CyrilKrylatov/4703582 to your computer and use it in GitHub Desktop.
Save CyrilKrylatov/4703582 to your computer and use it in GitHub Desktop.
TL;DR IE sucks as hell How to get windows height that will be compatible with all the majors browsers ?
var getWindowHeight = function() {
if (typeof(window.innerWidth) == 'number') {
windowHeight = window.innerHeight;
} else if (document.documentElement && document.documentElement.clientHeight) {
windowHeight = document.documentElement.clientHeight;
}
return windowHeight;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment