javascript for pages | JS分页
##How to use
###1.Init | 初始化
[English]
SlimPage.init("body",5,20,100);
The first param is the dom where you want to add the page square.For example:".class" or "#id".
The second param is the page now.You can get it from the url,or get it by ajax,or set it when rendering the html template.
The third param is the pagesize.
The last param is total of the pages.
[Chinese]
SlimPage.init("body",5,20,100);
第一个参数表示需要添加分页区域的元素 例如 ".class" or "#id"
第二个参数表示当前在第几页,可以通过url获取,或者ajax取数据时获取,或者渲染模板时获取等
第三个参数表示一页的数据条数
第四个参数表示总页数
###2.Show pages html | 显示分页区域
SlimPage.showPage();
Of course you shoud init it before show page.
调用时请确保已进行初始化
###3.Aboun webpage-jumping | 关于分页
When we click on the page num,the webpage will jump to the url: baseurl?page=x .
点击页码后跳转到的url为:当前的基本url(已除去参数)?page=x
###4.How to add other params in url | url跳转时传递其他参数
SlimPage.Params.cat = 5;
We can add some params to SlimPage.Params,if we do this,when we click to jump,the url is: baseurl?page=x&cat=5 .
我们可以通过给SlimPage.Params对象添加其他需要传递的参数,这样我们点击页码跳转到的url为:当前的基本url(已除去参数)?page=x&cat=5
##Contact me
Jesus Slim
Email1:[630405377@qq.com]
Email2:jesus.slim@yahoo.com
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
1. 开源生态
2. 协作、人、软件
3. 评估模型