jQuery ajax分页

时间:2011-04-12 19:08:03

标签: ajax jquery pagination jquery-pagination

我想通过ajax和Pagination plugin设置jquery分页。不幸的是,我无法让example显示多个结果(即使我更改了items_per_page设置后)。我怎样才能让它发挥作用?可以从github downloaded获得。

1 个答案:

答案 0 :(得分:0)

看起来items_per_page设置仅在内部使用,并不影响其显示结果的方式

  

items_per_page的   每页的项目数。最大页数是通过items_per_page(向上舍入,最小为1)除以项目数来计算的。请注意:此值仅用于计算页数。实际选择与当前页面和项目数量相关的项目必须由您的回调函数中的代码完成!默认值:10

如果您想使用某种跳过来增加每页的项目,则需要更新此功能

function pageselectCallback(page_index, jq){
     var new_content = $('#hiddenresult div.result:eq('+page_index+')').clone();
     $('#Searchresult').empty().append(new_content);
     return false;
}

所有这一切都是在当前页面索引处复制元素,即1-3。