When I use
$(document).ready(function() {
var bodyHeight = $(\"body\").height();
console.log(bodyHeight);
});
I get a really wack number
You want to look at the $(window).load()
function rather than $(document).ready()
.
The $(document).ready()
event executes when the HTML DOM is loaded and ready, even if all the graphics haven't loaded yet. The $(window).load()
event executes later when the complete page is fully loaded, including all frames, objects and images.
Here is a great link describing the difference. http://4loc.wordpress.com/2009/04/28/documentready-vs-windowload/