OK, I\'m losing my mind over this. I did read here at SO and google about it, I even have the preloader set (found here on SO), but none of the plugins/code I found helped me. <
I have a plugin named waitForImages that lets you attach a callback when descendent images have loaded.
In your case, if you wanted to wait for all assets to download, $(window).load()
may be fine. But you could do it a bit cooler with my plugin :)
var loading = $('#loading');
$('body').waitForImages(function()
{
loading.addClass('hidden');
}, function(loaded, total)
{
loading.html(loaded + ' of ' + total);
});