1

我正在使用无限滚动通过 ajax 将新内容/图像加载到 wordpress 主题的索引中。

该网站位于: http : //mylife.holstee.com/

这是我正在使用的代码,它在require.js中很深,并且被缩小了,所以你自己看不到它。

$container.infinitescroll({
        nextSelector: "#mylife-quinary .next-link a",
        navSelector: "#mylife-quinary .next-link",
        itemSelector: "#mylife-quaternary .item"
    }, function( newElements ) {
        mylife.quote();
        var $newElems = $( newElements ).css({ opacity: 0 });;
        $newElems.imagesLoaded(function(){
            $newElems.animate({ opacity: 1 });
            $container.masonry( 'appended', $newElems );
        });
    }
);

$container.imagesLoaded( function(){
    $container.masonry({
        itemSelector : '.item',
        columnWidth : $(".item").outerWidth(true)
    });
});

我想要的是一个更流畅的界面,这样你就不必等待新的内容了。有任何想法吗?

4

1 回答 1

2

来自www.infinite-scroll.com

element.infinitescroll({
// ...
  bufferPx : 40,
    // increase this number if you want infscroll to fire quicker
    // (a high number means a user will not see the loading message)
    // new in 1.2
    // default: 40
// ...
});
于 2013-07-15T14:29:10.510 回答