IE9 does not properly support the complete property of an image
Don't really think this is related to jQuery but I thought I would post it here in case someone else was having a problem. I have a plug-in I made that uses an image preloader involving the jquery .load() function. Once all images are preloaded, a function is fired to initiate the plugin.
If the image is already loaded in the cache, the script checks the .complete property of the image to see if it is true, then manually fires the callback function for the load script. Here is the code:
- $imageElements.each(function () {
// Attempt to load the images
$(this).load(function () {
// Add to number of images loaded and see if they are all done yet
loadedImages++;
console.log(loadedImages);
if (loadedImages == totalImages) {
// All done, perform callback
callback();
}
});
// The images may already be cached in the browser, in which case they
// would have a 'true' complete value and the load callback would never be
// fired. This will fire it manually.
if (this.complete) {
$(this).trigger('load');
}
});
IE9 will load the carousel fine at first page load, but when using the refresh button the complete property is false and the load function never gets called.
Trying to figure this one out