3 Star 5 Fork 1

JesusSlim / slimpagejs

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

slimpagejs

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

The MIT License (MIT) Copyright (c) 2015 JesusSlim Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

js分页封装调用 基于jQuery 展开 收起
JavaScript
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
JavaScript
1
https://gitee.com/JesusSlim/slimpagejs.git
git@gitee.com:JesusSlim/slimpagejs.git
JesusSlim
slimpagejs
slimpagejs
master

搜索帮助