In jQuery when you do this:
$(function() {
alert(\"DOM is loaded, but images not necessarily all loaded\");
});
It waits for the DOM to
I would recommend using imagesLoaded.js
javascript library.
$(window).load()
?As ansered on https://stackoverflow.com/questions/26927575/why-use-imagesloaded-javascript-library-versus-jquerys-window-load/26929951
It's a matter of scope. imagesLoaded allows you target a set of images, whereas
$(window).load()
targets all assets — including all images, objects, .js and .css files, and even iframes. Most likely, imagesLoaded will trigger sooner than$(window).load()
because it is targeting a smaller set of assets.