Thanks for the reply bwatanabe.` I ask because I am still running into a few problems.
I've tried a few different configurations, and I either end up with overlapped images, or the following error:
newElements is not defined in regards to var $newElems = $( newElements ).css({ opacity: 0 });
In my header I have the following:
jQuery(function(){
var $container = jQuery('#excerpts');
$container.imagesLoaded(function(){
$container.masonry({
// itemSelector: '.box',
// columnWidth: 100
});
});
$container.infinitescroll({
navSelector : '.navigation', // selector for the paged navigation
nextSelector : '.navigation a', // selector for the NEXT link (to page 2)
itemSelector : '.excerpt', // selector for all items you'll retrieve
loading: {
finishedMsg: 'No more pages to load.',
img: 'http://i.imgur.com/6RMhx.gif'
}
},
// trigger Masonry as a callback
function( newElements ) {
// hide new items while they are loading
var $newElems = $( newElements ).css({ opacity: 0 });
// ensure that images load before adding to masonry layout
$newElems.imagesLoaded(function(){
// show elems now they're ready
$newElems.animate({ opacity: 1 });
$container.masonry( 'appended', $newElems, true );
});
}
);
});
And in the plugin settings I have the following for my callback:
var $newElems = $( newElements ).css({ opacity: 0 });
$newElems.imagesLoaded(function(){
$newElems.animate({ opacity: 1 });
$('#excerpts').masonry( 'appended', $newElems, true );
});
I have tried so many things that my code is somewhat butchered, haha. But do either of you notice something that I am doing wrong?
Again, thank you so much for the help. This is another reason why I love the WordPress community.