I'm using Isotope plugin with Infinite Scroll plugin. With the default settings Infinite Scroll automatically triggers loading new elements which is fine, however, I would rather have a button "Load more images".
I'm only missing a small piece of code that will get new elements from Infinite scroll that I can pass to isotope INSERT function. Please see my comments below in code:
// initialize infinite scroll
$container.infinitescroll({
navSelector : '#paging', // selector for the paged navigation
nextSelector : '#paging a', // selector for the NEXT link (to page 2)
itemSelector : '.col', // selector for all items you'll retrieve
loading: {
msgText: 'Loading...',
finishedMsg: Loaded all!',
}
} // <-- NOTE that we do not use callback function here!
);
$(window).unbind('.infscr');
$('#paging a').click(function(){
// NEED CODE HERE TO GET NEW ELEMENTS FROM INFINITE SCROLL AND PASS THOSE ELEMENTS TO $container.isotope('insert', $(newElements));
});