Skip to content

Instantly share code, notes, and snippets.

@stefano-bortolotti
Last active December 24, 2015 02:19
Show Gist options
  • Save stefano-bortolotti/6730288 to your computer and use it in GitHub Desktop.
Save stefano-bortolotti/6730288 to your computer and use it in GitHub Desktop.
get the viewport height
function getViewportHeight() {
var docElement = document.documentElement,
client = docElement['clientHeight'],
inner = window['innerHeight'];
if ( client < inner )
return inner;
return client;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment