Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Masonry/Infinite Scrool

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #165160
    ralphsmouse
    Participant

    I copied most of this code of off David DeSandro’s own masonry with infinite scroll code.

    For some reason it doesn’t even attempt to load.

    What’s wrong?

    <script type="text/javascript">
        $(document).ready(function() {
        
        var $container = $('#posts');
        var height = $container.height();
        if( height > 1377 ) { // or some other number
        $container.height( height ); 
    }
    
        $(window).load(function(){
          $container.masonry({
            itemSelector: '.entry',
            singleMode: false,
            isResizable: false,
            isAnimated: false,
            animationOptions: {
            duration: '200',
            easing: 'linear',
            queue: false
            }
          });
        });
    
    $container.infinitescroll({
          navSelector  : '#nav',
          nextSelector : '#nav a#next',
          itemSelector : '.entry',
          loading: {
              finishedMsg: 'No more pages to load.',
              img: 'http://i.imgur.com/6RMhx.gif'
            }
          },
          function( newElements ) {
            var $newElems = $( newElements ).css({ opacity: 0 });
            $newElems.imagesLoaded(function(){
              $newElems.animate({ opacity: 1 });
              container.masonry( 'appended', $newElems, true ); 
            });
          }
        );
    });
    </script>
    
    #165161
    ralphsmouse
    Participant

    I’ll note that this is a Tumblr website.

    Here’s the paginiation part.

    {block:Pagination}<div id="nav"><div class="left">{block:NextPage}<a href="{NextPage}" id="next">Next</a>{/block:NextPage}</div> <div class="right">{block:PreviousPage}<a href="{PreviousPage}" id="previous">Previous</a>{/block:PreviousPage}</div></div>{/block:Pagination}

    #165286
    elneco
    Participant

    is there an example url? do you see any errors in the console?

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.