ImagesLoaded 4.1.0 Meteor package @See desandro/imagesloaded jQuery plugin.
meteor add smaltcreation:imagesloaded
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.