仿豆瓣分页代码js版

in Develop

其实也谈不上什么特色,只是将原本在服务器端处理的事情交到了客户端而已。

刚好在今天的项目中用到了,晚上回来后用在了feed上。

这段代码是从懒人上下载下来的,原代码中是没有页面中的其它参数的。

如:x.aspx?i=1&t=q&page=2,经过它处理后可能会丢失i、t这二个参数,所以需要修改它的版本。

我修改后的版本:

function RenderPager(recordCount,currentPage,pageSize,pageCount,pagerID,param)

参数说明:

recordCount  记录数
currentPage 当前页码(可以在js中获取)
pageSize每页记录数
pageCount 总页数(当然也可以在js中计算)
pagerID 最终分页代码展示在哪个html容器中
param其它参数,如:key=asdf&t=11&page={0}

{0}为占位符,在js中用页码数来填充。

Pager.rar (993.00 bytes)

0 Comments

Leave a Reply

Using Gravatars in the comments - get your own and be recognized!

XHTML: These are some of the tags you can use: <a href=""> <b> <blockquote> <code> <em> <i> <strike> <strong>