0

我有这个代码:mansory + 无限滚动 jquery 插件来显示多个框。但是当我打开我的页面时,下一个内容的加载是在我滚动页面而不是在页面末尾时开始的。我错了什么?

        $container.infinitescroll({
            navSelector  : '#page-nav',    // selector for the paged navigation 
            nextSelector : '#page-nav a',  // selector for the NEXT link (to page 2)
            itemSelector : '.box',     // selector for all items you'll retrieve

            // enable debug messaging ( to console.log )
            loading: {
                finishedMsg: 'Pagine da caricare terminate.',
                img: 'http://i.imgur.com/6RMhx.gif'
               }
              },
            // 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 ); 
              });
             }
          );
4

1 回答 1

0

$container.masonry( 'appended', $newElems, true ); 应更改为 $container.append( $newElems ).masonry( 'appended', $newElems, true ); 手段...应首先将项目添加到容器中。

于 2012-04-24T05:53:09.463 回答