How can I detect when an image has finished loading be it from the server or the browser cache?
I want to load various images in the same tag and d
From a very similar question Official way to ask jQuery wait for all images to load before executing something and just like Pikrass says:
With jQuery, you use
$(document).ready()to execute something when the DOM is loaded and$(window).load()to execute something when all other things are loaded as well, such as the images.
Here are two examples:
jQuery(document).ready(function(){
console.log('DOM ready');
});
jQuery(window).load(function(){
console.log('all other things ready');
});
You should be able to confirm in your console:
screenshot-with-shadow.png http://img547.imageshack.us/img547/9681/yih.png