desandro / imagesloaded

:camera: JavaScript is all like "You images done yet or what?"

Home Page:https://imagesloaded.desandro.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

what does ```instance``` do in your sample init code in README.md?

englishextra opened this issue · comments

Please explain, 'cause jshint says it's never used

imgLoad.on( 'fail', function( instance ) {
  console.log('FAIL - all images loaded, at least one is broken');
});

or here:

imgLoad.on( 'progress', function( instance, image ) {
  var result = image.isLoaded ? 'loaded' : 'broken';
  console.log( 'image is ' + result + ' for ' + image.img.src );
});

instance is the instance of imagesLoaded. It's useful when use its properties

@desandro Oh yeah, it's just that I didn't make use of instance, the jshint says it's never used, thanks