Cross Browser Document Height


/ Published in: Other
Save to your folder(s)



Copy this code and paste it in your HTML
  1. // found at http://james.padolsey.com/javascript/get-document-height-cross-browser/
  2. function getDocHeight() {
  3. var D = document;
  4. return Math.max(
  5. Math.max(D.body.scrollHeight, D.documentElement.scrollHeight),
  6. Math.max(D.body.offsetHeight, D.documentElement.offsetHeight),
  7. Math.max(D.body.clientHeight, D.documentElement.clientHeight)
  8. );
  9. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.