JQuery check if image has loaded before binding .load () event
I have a coverflow plugin for jQuery that needs to adjust to the tallest image from a series of images.
It currently uses an anchor .load()
for each image and configures the plugin after the counter indicates that all images have been loaded. I was told it is unreliable in all browsers.
Typically, most of these images are already loaded into the browser cache, so the binding .load()
takes a lot longer than necessary.
To reduce the overhead, I would like to keep the number of bindings .load()
as low as possible , using only bindings .load()
for images that have not yet been loaded.
How can you tell the difference between images that have already been loaded from images that have not been loaded yet?
source to share