Check Image Loaded : Duplicate?
Hi All,
Im checking to see if an image is loaded, before removing a loading div:
- // see if first image loaded
$("#images img:last").one("load",function(){
infoDiv.load(hash + '?type=2', function() { // load text content
maskDiv.stop().animate({opacity:0},500, function(){ // remove loading cover
maskDiv.removeClass('loading');
});
});
})
.each(function(){
if(this.complete) $(this).trigger("load"); // catch cached images
});
The images are loaded via a prior ajax load call, could this mean they are loaded twice?
Please see the dev site below:
http://theworkingtitle.co.uk/clients/watson/#products/aa/ Are the images loading twice, or is there a better way to do this?
Any help appreciated,
Thanks.
Ian.
P.S I've set the loading div to a slight opacity for debugging, so you can see the images load behind.