Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.

I am using masonry and infinite scroll in my theme but

+1 vote
559 views
asked Jun 19, 2014 in Q2A Core by anonymous

it's duplicating some questions , here is the my code ; if I can do this i will share my theme here free

  $(function(){
 
    var $container = $('#container');
 
    $container.imagesLoaded(function(){
      $container.masonry({
itemSelector : '.box',
isFitWidth: true,
columnWidth: 236,
gutter: 14
      });
 $('#loading').hide();
    });
 
    $container.infinitescroll({
      navSelector  : '.qa-page-links-list',    // selector for the paged navigation
      nextSelector : '.qa-page-links-list .qa-page-next',  // selector for the NEXT link (to page 2)
      itemSelector : '.box'     // selector for all items you'll retrieve
      },
      // trigger Masonry as a callback
      function( newElements ) {
        // hide new items while they are loading
        var $newElems = $( newElements ).css({ opacity: 0 });
        // ensure that images load before adding to masonry layout
        $newElems.imagesLoaded(function(){
          // show elems now they're ready
          $newElems.animate({ opacity: 1 });
          $container.masonry( 'appended', $newElems, true );
        });
      }
    );
  });
commented Jun 20, 2014 by QA-Themes
I can't see any problem in your code that can cause duplicate questions. did this happen without masonry code?

Please log in or register to answer this question.

...