🔔 Alert..!! Get 2 Month Free Cloud Hosting With $200 Bonus From Digital Ocean ACTIVATE DEAL

This is the jQuery version of the imgStatus library, which makes it easy to detect the image loading status and provide callback functions when the images are completely loaded.

image-loading

Documentation

imagesStatus

A javascript plugin (with jQuery support) to detect the status of images loading

Based on imgStatus https://github.com/raphamorim/imgStatus written originally by Raphael Amorim, Rewritten almost totally to provide a simple way to deal with images loading, made in a nice way with callbacks for the image status with the support of jQuery for people who want to use it in the jQuery plugin way.

Vanilla Javascript :

imagesStatus('.imageContainerDiv', {      imgLoaded: function(img){         console.log(this.status.loaded);         console.log(img);     },      imgFailed: function(img){         console.log(this.status.failed);         console.log("-------failed---------------");         console.log(img);         console.log("-----------------------------");     },      allImgFinished: function(container){         console.log("all images loaded");         console.log(this.status.loaded + " images loaded, " + this.status.failed + " images failed!");     }   });  

jQuery :

$(".imageContainerDiv").imagesStatus({      imgLoaded: function(img){         console.log(this.status.loaded);         console.log(img);     },      imgFailed: function(img){         console.log(this.status.failed);         console.log("-------failed---------------");         console.log(img);         console.log("-----------------------------");     },      allImgFinished: function(container){         console.log("all images loaded");         console.log(this.status.loaded + " images loaded, " + this.status.failed + " images failed!");     }   }); 

Feedback

Please use the Issues for any bugs, feature requests, etc.

License

MIT License


You May Also Like