Created
May 14, 2016 16:20
-
-
Save adastreamer/5642a37c5ba6c4317db89a18e5170faa to your computer and use it in GitHub Desktop.
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
var getHeight = function(){ | |
var viewport = new Object(); | |
viewport.height = 0; | |
// the more standards compliant browsers (mozilla/netscape/opera/IE7) | |
//use window.innerWidth and window.innerHeight | |
if (typeof window.innerHeight != 'undefined') | |
{ | |
viewport.height = window.innerHeight | |
} | |
else if (typeof document.documentElement != 'undefined' | |
&& typeof document.documentElement.clientHeight != | |
'undefined' && document.documentElement.clientHeight != 0) | |
{ | |
viewport.height = document.documentElement.clientHeight | |
} | |
else | |
{ | |
viewport.height = document.getElementsByTagName('body')[0].clientHeight | |
} | |
return viewport.height; | |
}; | |
var docHeight = getHeight(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment