Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save zhuzhuaicoding/d8adc822164e616599c15548ba8d930f to your computer and use it in GitHub Desktop.
Save zhuzhuaicoding/d8adc822164e616599c15548ba8d930f 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)
);
}
@zhuzhuaicoding
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment