0
$('#content').infinitescroll({
        binder: $(window),
        debug: true,
        itemSelector : ".post",
        navSelector  : "#pagination",
        nextSelector : "#next-page"

        },function(arrayOfNewElems){  

    });

基本上,我想显示我的 Tumblr 帖子的数量。我进行了不同的尝试,但是每次加载新内容后索引编号都从 0 重新开始。如何使数字成为以前加载的帖子的延续。

我应该调用什么样的函数

函数(arrayOfNewElems){

});

这是我使用的插件

https://github.com/paulirish/infinite-scroll

4

2 回答 2

0

Just do:

var totalPosts = null;

$.ajax({
    url: "http://[BLOG NAME HERE].tumblr.com/api/read/json",
    dataType: 'jsonp',
    success: function(results){
        totalPosts = results['posts-total'];
        alert(totalPosts);
    }
});

Needs jQuery but can be run before the document is loaded.

于 2013-08-27T17:40:13.540 回答
0

为什么你需要获取你的帖子的索引号?我认为这也可以工作

使用 proto.jp 无限滚动

http://codysherman.com/tools/infinite-scrolling

于 2013-08-27T15:44:38.353 回答