JavaScript
Article
By Sam Deering

jQuery Run Code After Image Loads

By Sam Deering

Simple jQuery code snippet to wait for an image to load before running some code. The only drawback is you would need to supply the image name (including extension).

$('#myImage').attr('src', 'image.jpg').load(function() {  
	//run code
	alert('Image Loaded');  
});
Recommended
Sponsors
Get the latest in JavaScript, once a week, for free.