0

我正在创建一个 3 列的 tumblr 主题,并尝试对帖子应用无限滚动和砌体。砌体仅适用于“每页帖子”的数量(例如,如果设置为 15,砌体将仅适用于前 15 个帖子)。我到处寻找,但找不到任何东西。这是我的代码:

<script type="text/javascript" src="http://static.tumblr.com/imovwvl/rSGl20lfv/masonry.js"></script>

{block:IfInfiniteScroll}
<script type="text/javascript" src="http://proto.jp/js/tumblrAutoPager.js"></script>
{/block:IfInfiniteScroll}

<script src="http://static.tumblr.com/thpaaos/lLwkowcqm/jquery.masonry.js"></script>

<script type="text/javascript">
$(window).load(function () {
$('#postCnts').masonry(),
$('.masonryWrap').infinitescroll({
navSelector : "div#pgNvgt",
// selector for the paged navigation (it will be hidden)
nextSelector : "div#pgNvgt a#nextPage",
// selector for the NEXT link (to page 2)
itemSelector : ".post",
// selector for all items you'll retrieve
bufferPx : 10000,
extraScrollPx: 10,
loadingImg : "http://b.imagehost.org/0548/Untitled-2.png",
loadingText : "<em></em>",
},
// call masonry as a callback.
function() { $('#postCnts').masonry({ appendedContent: $(this) }); }
);
});

</script>

援助会非常好!

4

1 回答 1

0

您应该升级到最新版本的脚本 (v2.1.05)。您正在使用 v 1.0.1。

你还有两个 masonry.js 文件,你只需要一个。

我建议在 tumblrAutoPager 和 imagesLoaded 插件上使用 jqueryInfiniteScroll 而不是 $(window).load http://masonry.desandro.com/docs/help.html

于 2012-05-02T20:06:54.857 回答