Skip to content

Instantly share code, notes, and snippets.

@imyelo
Last active August 29, 2015 13:56
Show Gist options
  • Save imyelo/8932123 to your computer and use it in GitHub Desktop.
Save imyelo/8932123 to your computer and use it in GitHub Desktop.
wait lazyload for testing
(function () {
var count = 0;
var $lazy = $('.img-lazy-load');
var every = function () {
return _.every($lazy, function (elem) {
return elem.loaded;
});
};
$lazy.on('load', function () {
if (every()) {
console.log('done');
} else {
console.log(++count);
}
}).trigger('appear');
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment