Skip to content

Instantly share code, notes, and snippets.

@nosp4mSnippets
Created June 25, 2013 17:22
Show Gist options
  • Save nosp4mSnippets/5860404 to your computer and use it in GitHub Desktop.
Save nosp4mSnippets/5860404 to your computer and use it in GitHub Desktop.
JS: get Document Height
function getDocHeight() {
var D = document;
return Math.max(
Math.max(D.body.scrollHeight, D.documentElement.scrollHeight),
Math.max(D.body.offsetHeight, D.documentElement.offsetHeight),
Math.max(D.body.clientHeight, D.documentElement.clientHeight)
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment