Last active
August 29, 2015 14:18
-
-
Save frankschrijvers/a51f2a288baf2016ca66 to your computer and use it in GitHub Desktop.
Infinite Scroll Behavior Masonry Integration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
-------------------------------- | |
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