我正在使用以下 jQuery InfiniteScroll插件,该插件实际上可以工作,但会一遍又一遍地加载最后一页,无法停止。这是我使用的代码:
$('#catalog').infinitescroll({
navSelector : "div.page-nav:last",
// selector for the paged navigation (it will be hidden)
nextSelector : "div.page-nav a.navnext:last",
// selector for the NEXT link (to page 2)
itemSelector : "#catalog div.single",
// selector for all items you'll retrieve
bufferPx : 400
});
我的分页如下所示:
<div id="page-nav" class="page-nav">
<div class="top">
<a id="page-1" class="active">1</a>
<a id="page-2" href="?page=2">2</a>
<a id="page-3" href="?page=3">3</a>
<a id="page-4" href="?page=4">4</a>
<a id="page-5" href="?page=5">5</a>
<a id="page-6" href="?page=6">6</a>
<a id="page-7" href="?page=7">7</a>
</div>
<div class="bottom">
<span class="right">
<a class="navnext" href="?page=2" id="next-2">Next</a>
<span class="next">Ctrl</span>
</span>
</div>
</div>