Using a little plain javascript is usually easier when checking for image.onload
:
$("img[src$='gif']").each( function() {
var self = $(this).css({'opacity': '0.05'});
var img = new Image();
img.onload = function() {
self.fadeTo('fast', 1)
}
img.src = this.src;
if (img.complete) img.onload();
});
And note that fadeIn()
only works with hidden images, not images that are visible with a lower opacity, which is the real issue with your code.