I know that for the image onload to work you have to set the src after the onload handler was attached. However I want to attach onload handlers to images that are static in
Okay, I turned Borgars answer into a plugin, here it is:
$.fn.imageLoad = function(fn){ this.load(fn); this.each( function() { if ( this.complete && this.naturalWidth !== 0 ) { $(this).trigger('load'); } }); }