Skip to content

Instantly share code, notes, and snippets.

@samuelcotterall
Created August 29, 2012 16:10
Show Gist options
  • Save samuelcotterall/3514959 to your computer and use it in GitHub Desktop.
Save samuelcotterall/3514959 to your computer and use it in GitHub Desktop.
infinatescroll/masonry
$(window).load(function () {
$('.posts').masonry();
$('.masonryWrap').infinitescroll({
debug: true, // Remove this before going live
navSelector : "div#navigation", // selector for the paged navigation (it will be hidden)
nextSelector : "div#navigation a#nextPage", // selector for the NEXT link (to page 2)
itemSelector : ".entry", // selector for all items you'll retrieve
bufferPx : 10000,
extraScrollPx : 11000,
loadingImg : "", // Removes "http://www.infinite-scroll.com/loading.gif"
loadingText : "", // Removes "Loading the next set of posts..."
donetext : "" // Removes "Congratulations, you've reached the end of the internet."
},
function() {
console.log('Loaded new content'); // Remove this before going live
// call masonry as a callback.
$('.posts').masonry({ appendedContent: $(this) });
}
);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment