desandro/imagesloaded — Issue #27: Possible IE9 issue - imagesLoaded not firing events in certain cases
Author: picunrelated
Created: 2012-03-01 20:45:28+00:00
State: open

Example:
http://jsfiddle.net/3xmut/4/

What this script does:
Sequential pre-loading of a list of images.

Expected behavior:
The script loads and caches the three images in the list, and when completed, displays 100% in the HTML <div /> element.
There's no problem in Chrome or Firefox.
The point of this script is to guarantee images used in CSS background-image URLs are cached when needed.

Issue:
* This issue does not occur if the IE9 "F12 Developer's Tools" console is open before the script runs. *
In IE9, with no dev console open, this script stays at 0%.
The load or fail event is not called for the first image in the list, so nothing happens.

Notes:
If I place an alert() in the preloadImage method, it fixes the issue in IE9, much like having the dev console open before the script loads.

I may be using imagesLoaded incorrectly, but it does do what I want it to do in Chrome and Firefox.