Skip to content

Instantly share code, notes, and snippets.

@frankschrijvers
Last active August 29, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frankschrijvers/a51f2a288baf2016ca66 to your computer and use it in GitHub Desktop.
Save frankschrijvers/a51f2a288baf2016ca66 to your computer and use it in GitHub Desktop.
Infinite Scroll Behavior Masonry Integration
/*
--------------------------------
Infinite Scroll Behavior
Masonry Integration
--------------------------------
+ https://github.com/paulirish/infinitescroll/
+ version 2.0b2.110617
+ Copyright 2011 Paul Irish & Luke Shumard
+ Licensed under the MIT license
+ Documentation: http://infinite-scroll.com/
*/
(function( newElements) {
$.extend($.infinitescroll.prototype,{
_callback_masonry: function infscr_callback_masonry (newElements) {
var $newElems = $( newElements ).css({ opacity: 0 });
$('#container').imagesLoaded( function(){
$('#container').masonry('appended',$(newElements));
$newElems.animate({ opacity: 1 });
});
}
});
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment