Skip to content

Instantly share code, notes, and snippets.

@Stanton
Created June 11, 2012 08:29
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 Stanton/2909088 to your computer and use it in GitHub Desktop.
Save Stanton/2909088 to your computer and use it in GitHub Desktop.
Get document height
function getDocumentHeight() {
return Math.max(
Math.max(document.body.scrollHeight, document.documentElement.scrollHeight),
Math.max(document.body.offsetHeight, document.documentElement.offsetHeight),
Math.max(document.body.clientHeight, document.documentElement.clientHeight)
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment