Adding a Manual Trigger to Infinite Scrolling in a Masonry Theme
-
Hey guys,
inspired by the PinBin theme, I finanlly managed to put together Infinite Scrolling and Mansonry in my own WordPress theme. But I am not able to switch the script from the default automatic loading to the manual trigger mode. I already tried it with behaviour: ‘Twitter’, but it wasn’t successful either. Maybe you can help me, please.
Here is the relevant part of the javascript code:
$masonry.infinitescroll({
navSelector : ‘#navigation_below’,
nextSelector : ‘#navigation_below .navigation_previous a:first’,
itemSelector : ‘.post’,
loading: {
msgText: ”,
finished: function() {},
},
}, function(newElements) {
var $newElems = $(newElements);
if ($(document).width() <= 480) {
$newElems.imagesLoaded(function(){
$(‘#infscr-loading’).fadeOut(‘normal’);
$masonry.masonry(‘appended’, $newElems, true);
});
} else {
$(‘#infscr-loading’).fadeOut(‘normal’);
$masonry.masonry(‘appended’, $newElems, true);
}
});Thanks a lot!
Alex
- The topic ‘Adding a Manual Trigger to Infinite Scrolling in a Masonry Theme’ is closed to new replies.