javascript - Trigger infinitescroll manually -
javascript - Trigger infinitescroll manually -
i using next code trigger infinitescroll on isotope masonry, how utilize "click load more posts" instead, "the manual trigger". tried implementing solutions on net not work me. thanks.
/*--------------------------------------------------------------------------------*/ /* infinitescroll /*--------------------------------------------------------------------------------*/ jquery(document).ready(function($) { var $container = $('.masonry'); $container.imagesloaded( function(){ $container.isotope({ itemselector : '.item' }); }); $container.infinitescroll({ // selector paged navigation navselector : '.post-nav', // selector next link (to page 2) nextselector : '.post-nav .prev-post a', // selector items you'll retrieve itemselector : '.item', loading: { finishedmsg: 'no more pages load.', img: 'http://i.imgur.com/qkky8.gif' } }, function( newelements ) { var $newelems = $( newelements ).css({ opacity: 0 }); $newelems.imagesloaded(function() { $newelems.animate({ opacity: 1 }); $container.isotope( 'appended', $( newelements ) ); $container.isotope('relayout'); }); }); });
assuming you're using this plugin, next should work manually trigger retrieve:
$container.infinitescroll('retrieve');
javascript wordpress infinite-scroll
Comments
Post a Comment