JavaScript
Article

jQuery Get Length of Webpage

By Sam Deering

jQuery code snippet to get the length (height) of a web page.

var webpage = $("body");
var webpage_height = webpage.height();
alert(webpage_height);

Note you can also use: $(document).height() or $(window).height() instead of body selector.

Recommended
Sponsors
Because We Like You
Free Ebooks!

Grab SitePoint's top 10 web dev and design ebooks, completely free!

Get the latest in JavaScript, once a week, for free.