JavaScript - - By Sam Deering

jQuery Run Code After Image Loads

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');  
});
Sponsors