-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Description
First, thanks for keeping infinite-scroll alive and updating it new heights
I have old v2 code which I tried to update to new v3 API and in some ways not sure how to completely change as it uses old Infinite Scroll, ImageLoaded, Isotope and callback function to launch fancyBox too:
$(function() {
var $container = $('.main-content');
$container.imagesLoaded({
background: true
}, function() {
$container.isotope({
itemSelector: '.post-article',
layoutMode: 'masonry',
transitionDuration: '1s'
});
});
$container.infinitescroll({
itemSelector: ".post-article",
navSelector: "#pagination",
nextSelector: "#pagination #next-page a",
loading: {
finished: undefined,
finishedMsg: "",
msg: null,
msgText:"",
selector: null,
speed: 'fast',
start: undefined
},
bufferPx: 5500,
prefill:true,
debug: true,
animate:false
},
// trigger Masonry as a callback
function(newElements) {
var $newElems = $(newElements).css({
opacity: 0
});
// ensure that images load before adding to masonry/isotope layout
$newElems.imagesLoaded(function() {
$newElems.animate({
opacity: 1
});
$container.isotope('appended', $newElems);
$newElems.each(function()
{
$(this).find(".image-thumbnail a").each(openFancyBox);
});
});
}
);
});
Metadata
Metadata
Assignees
Labels
No labels