Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Cameron White
5,481 PointsAdding Infinitescroll to Masonry
In the process of coding a theme from my photoblog. I’ve got masonry working, but so far no luck with infinitescroll… and masonry seems to be removing my pagination links. Anyone familiar with these two jQuery plug-ins? I could use some insight.
Here the JS I have currently
$(function(){
$('#contents').masonry({
itemSelector : 'article',
columnWidth : 420
});
});
var $container = $('#contents');
$container.imagesLoaded(function(){
$container.masonry({
itemSelector : 'article',
columnWidth : 420
});
});
$('#contents').infinitescroll({
navSelector : ".pagination",
// selector for the paged navigation (it will be hidden)
nextSelector : ".pagination a:last-child",
// selector for the NEXT link (to page 2)
itemSelector : "article"
// selector for all items you'll retrieve
});