apamphilon

Masonry with infinite scroll

var $container = $('.blog-articles');
$container.infinitescroll({
    navSelector  : '.page-nav',    // selector for the paged navigation 
    nextSelector : '.nav-previous a',  // selector for the NEXT link (to page 2)
    itemSelector : '.blog-articles',     // 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 ) {
        var $newElems = $( newElements );
        $container.masonry( 'appended', $newElems );
    }
);

Comments: