infinite-scroll icon indicating copy to clipboard operation
infinite-scroll copied to clipboard

Twitter behaviour Nav needs to be clicked twice when all pages loaded for it to fadeOut with Isotope on Wordpress

Open dougalcrowder opened this issue 13 years ago • 2 comments

Hi I have a wordpress installation, where I have manually added Isotope and Infinite Scroll with the Manual trigger behaviour. It all works great except that when the final posts have been loaded the "Load More Posts" button doesn't disappear, it only disappears if you click it again.

Here is my code

jQuery(function($){

  var $container = $('.grid-inner');

  $container.isotope({
    itemSelector : '.post',
    animationEngine : 'jquery'
  });

  $container.infinitescroll({
    navSelector  : '#nav-below',    // selector for the paged navigation 
    nextSelector : '.circle a',  // selector for the NEXT link (to page 2)
    itemSelector : '.post',     // selector for all items you'll retrieve
    behavior     : 'twitter',
    loading: {
        finishedMsg: 'No more posts left',
        img: '/wp-content/themes/skeleton/images/ajax-loader.gif'
      }
    },
    // call Isotope as a callback
    function( newElements ) {
      $container.isotope( 'appended', $( newElements ) ); 
    }
  );

});

Any help would be really appreciated, thanks

dougalcrowder avatar Jun 25 '13 13:06 dougalcrowder

This is really a result of how Infinite-Scroll has to operate. In short, Infinite-Scroll does not know that you are out of pages until it either gets an error like a 404 or it gets a page and finds no content that matches that contentSelector option. Unless you write some custom code to handle this and let Infinite-Scroll know you have no more pages, it will have to work this way. There is really nothing we can do about it.

67726e avatar Jun 25 '13 13:06 67726e

Oh ok. Thanks for the reply.

dougalcrowder avatar Jun 25 '13 13:06 dougalcrowder