johnpolacek / imagefill.js

The jQuery plugin for making images fill their containers (and be centered)
http://johnpolacek.github.io/imagefill.js/
609 stars 89 forks source link

Imagefill doesn't run if at least one image fails to load #21

Closed Solybum closed 11 months ago

Solybum commented 4 years ago

imagesLoaded().done() expects all images to be confirmed loaded before executing, so if for any reason an image to be filled fails to load, no images will get filled.

https://github.com/johnpolacek/imagefill.js/blob/4165b58f89028911126e84c6bc39a69431b7b8c5/js/jquery-imagefill.js#L50

If there is no special reason to use done, it should be changed to always, which executes after all images were confirmed loaded or broken. https://github.com/desandro/imagesloaded#always