Home › Forums › JavaScript › Infinite Scroll + Masonry append help › Re: Infinite Scroll + Masonry append help
May 1, 2012 at 12:35 am
#102042
Member
Sorry, I can’t help you if you don’t use Paul Irish’s Infinite Scroll, I don’t know how the other one works. I’m working on a theme right now that utilizes this exact thing.
Here is the first bit to Masonry the first batch of posts (before IS):
$(document).ready(function() {
var $container = $('#content');
$container.imagesLoaded(function(){
$('#content').masonry({
// options
itemSelector : 'article',
columnWidth: 400,
gutterWidth : 40
});
});
});
And here is the IS code: (not the Masonry code in the callback)
I’ve also included some code that fixes video and audio posts (if you use them) that break when using infinite scroll.