我正在使用这个插件来实现无限滚动插件: http: //www.infinite-scroll.com/infinite-scroll-jquery-plugin/
下面是我将处理无限滚动的代码:
<ul class="pager">
<li class="current"><a href="#"><b>1</b></a></li>
<li><a href="http://localhost/freegames//cat/0/all/newest/p2">2</a></li>
<li><a href="http://localhost/freegames//cat/0/all/newest/p3">3</a></li>
<li><a href="http://localhost/freegames//cat/0/all/newest/p4">4</a></li>
<li><a rel="next" href="http://localhost/freegames//cat/0/all/newest/p2">»</a></li>
</ul>
下面是我的脚本:
<script>
function infiniteScroller() {
$('.homecont').infinitescroll({
navSelector : "ul.pager li.current a",
// selector for the paged navigation (it will be hidden)
nextSelector : "ul.pager li a[rel~="next"]",
// selector for the NEXT link (to page 2)
itemSelector : "div.ig"
// selector for all items you'll retrieve
});
}
</script>
当我加载页面时它不起作用。我错过了什么?任何帮助表示赞赏。