ImagesLoaded Meteor package
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
.gitignore
README.md
package.js

README.md

meteor-imagesloaded

ImagesLoaded 4.1.0 Meteor package @See desandro/imagesloaded jQuery plugin.

meteor add smaltcreation:imagesloaded

Example of usage

You can use imagesLoaded as a jQuery Plugin.

$('#container').imagesLoaded(function () {
  // images have loaded
});

// options
$('#container').imagesLoaded({
  // options...
  },
  function () {
    // images have loaded
  }
);

.imagesLoaded() returns a jQuery Deferred object. This allows you to use .always(), .done(), .fail() and .progress().

$('#container').imagesLoaded()
  .always(function (instance) {
    console.log('all images loaded');
  })
  .done(function (instance) {
    console.log('all images successfully loaded');
  })
  .fail(function () {
    console.log('all images loaded, at least one is broken');
  })
  .progress(function (instance, image) {
    var result = image.isLoaded ? 'loaded' : 'broken';
    console.log( 'image is ' + result + ' for ' + image.img.src );
  });

More documentation on desandro/imagesloaded GitHub repository.