Skip to content

Commit

Permalink
src : imagesLoaded v1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
desandro committed Sep 1, 2011
1 parent bbce973 commit dad18e1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
22 changes: 14 additions & 8 deletions jquery.masonry.js
Original file line number Diff line number Diff line change
Expand Up @@ -374,26 +374,32 @@


// ======================= imagesLoaded Plugin ===============================
// https://github.com/desandro/imagesloaded
/*!
* jQuery imagesLoaded plugin v1.0.3
* http://github.com/desandro/imagesloaded
*
* MIT License. by Paul Irish et al.
*/


// $('#my-container').imagesLoaded(myFunction)
// or
// $('img').imagesLoaded(myFunction)

// execute a callback when all images have loaded.
// needed because .load() doesn't work on cached images

// callback function gets image collection as argument
// `this` is the container

// original: mit license. paul irish. 2010.
// contributors: Oren Solomianik, David DeSandro, Yiannis Chatzikonstantinou

$.fn.imagesLoaded = function( callback ) {
var $images = this.find('img'),
var $this = this,
$images = $this.find('img').add( $this.filter('img') ),
len = $images.length,
_this = this,
blank = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==';

function triggerCallback() {
callback.call( _this, $images );
callback.call( $this, $images );
}

function imgLoaded() {
Expand All @@ -418,7 +424,7 @@
}
});

return this;
return $this;
};


Expand Down
2 changes: 1 addition & 1 deletion jquery.masonry.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit dad18e1

Please sign in to comment.