• I’m trying to get infinite scroll to work with masonry on a WordPress. Everything is fine but just when the new load post come up, they can’t get masonry to work.

    I fund a lot of people have same problem.
    I try to put some code in callback ( i don’t know any JS :(, but still can’t work.

    here is code in index.php

    <script type="text/javascript">
    jQuery(document).ready(function($){
      $('#linky').masonry({ singleMode: true });
    });
    </script>

    Here is code for 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 );
            });

    these code come from https://stackoverflow.com/questions/10898850/trouble-using-infinite-scroll-with-masonry-callback

    my website is here.
    https://blurfun.com/test/

    https://www.ads-software.com/extend/plugins/infinite-scroll/

  • The topic ‘new load post can't get masonry to work.’ is closed to new replies.