jquery之分页插件smartpaginator
今天推荐一个分页工具条插件:Smart Paginator,这个插件用途还是很广的,而且可定制性相当不错,目前内置三种颜色,有需要的话,可以自己改css定制颜色
1.如何使用Smart Paginator?
1.1引入以下几个文件
<script src="jquery-1.4.4.min.js" type="text/javascript"></script>
<script src="smartpaginator.js" type="text/javascript"></script>
<link href="smartpaginator.css" rel="stylesheet" type="text/css" />
1.2添加一个分页容器层
<div id="smart-paginator" > </div>
1.3初始化插件

$(document).ready(function() {
$('#smart-paginator').smartpaginator({
totalrecords: total,
recordsperpage: items_per_page,
next: '下一页',
prev: '上一页',
first: '首页',
last: '末页',
go: '前往',
theme: 'docloud-pagi',
initval: current_page,
onchange: onPageChange
});
}); function onPageChange(newPageValue) {
current_page = newPageValue;
//根据新的页码做一些改变,比如说页面更新操作
getImageList(newPageValue);
}

可以看到想要初始化Smart Paginator,需要配置不少参数,接下来来看下这些主要参数的含义。
2.参数说明
参数 |
默认值 |
类型 |
描述 |
totalrecords |
0 |
Number |
总的分页数 |
recordsperpage |
0 |
Number |
单页数据量 |
length |
10 |
Number |
这个参数很特殊,上一页、下一页、第一页、最后一页的显示控制依赖于这个参数,当length的值大于totalrecords/recordsperpage时,是不显示上一页、下一页、第一页、最后一页的 |
next |
Next |
String |
下一页文本 |
prev |
Prev |
String |
上一页文本 |
first |
First |
String |
第一页文本 |
last |
Last |
String |
最后一页文本 |
go |
Go |
String |
跳转文本 |
theme |
green |
Stirng |
模板 |
display |
double |
String |
|
initval |
1 |
Number |
默认显示第几页 |
datacontainer |
” |
String |
数据容器id,请看demo3 |
dataelement |
” |
String |
数据元素,指的是容器下的对应的子元素的选择器,请看demo2 |
onchange |
null |
Function |
分页改变后触发的函数 |
3.自定义颜色模板

.docloud-pagi
{
background-color: #F0F5FF;
}
.docloud-pagi.normal
{
background-color: #588500;
color: White;
border: solid 1px #5f9000;
}
.docloud-pagi.active
{
background-color: #344C00;
color: #F8EB00;
border: solid 1px #5f9000;
}
.docloud-pagi .btn
{
background-color: #588500;
color: White;
border: solid 1px #5f9000;
}

其它分页推荐:http://www.cnblogs.com/lhb25/archive/2012/08/08/ajax-jquery-pagination-plugin-tutorial.html
尤其推荐其中的:
jQuery Pagination Plugin
jquery之分页插件smartpaginator的更多相关文章
- 转:精心挑选的12款优秀 jQuery Ajax 分页插件和教程
在这篇文章中,我为大家收集了12个基于 jQuery 框架的 Ajax 分页插件,这些插件都提供了详细的使用教程和演示.Ajax 技术的出现使得 Web 项目的用户体验有了极大的提高,如今借助优秀的 ...
- jQuery Pagination分页插件
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- Jquery的分页插件
Jquery的分页插件, 用起来还不错. 来自: http://flaviusmatis.github.io/simplePagination.js/ 下载地址: https://github.c ...
- 12款优秀 jQuery Ajax 分页插件和教程
12款优秀 jQuery Ajax 分页插件和教程 在这篇文章中,我为大家收集了12个基于 jQuery 框架的 Ajax 分页插件,这些插件都提供了详细的使用教程和演示.Ajax 技术的出现使得 W ...
- jQuery Pagination分页插件--刷新
源码地址:https://github.com/SeaLee02/FunctionModule/blob/master/UploadFiles/WebDemo/FenYE/FenYeDemo.aspx ...
- Jquery前端分页插件pagination同步加载和异步加载
上一篇文章介绍了Jquery前端分页插件pagination的基本使用方法和使用案例,大致原理就是一次性加载所有的数据再分页.https://www.jianshu.com/p/a1b8b1db025 ...
- Jquery前端分页插件pagination使用
插件描述:JqueryPagination是一个轻量级的jquery分页插件.只需几个简单的配置就可以生成分页控件.并且支持ajax获取数据,自定义请求参数,提供多种方法,事件和回调函数,功能全面的分 ...
- JQuery Pagination 分页插件 增加了首页尾页以及跳转功能
JQuery分页插件 挺好用的 但是官方是没有提供首页尾页以及跳转功能 我觉得这个功能可以有,于是就改进了一下 一个js一个css从连接里面下 链接:http://pan.baidu.com/s/1n ...
- 精心挑选的12款优秀 jQuery Ajax 分页插件和教程
在这篇文章中,我为大家收集了12个基于 jQuery 框架的 Ajax 分页插件,这些插件都提供了详细的使用教程和演示.Ajax 技术的出现使得 Web 项目的用户体验有了极大的提高,如今借助优秀的 ...
随机推荐
- HW4.31
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...
- iOS按钮长按
UILongPressGestureRecognizer *longPressGR = [[UILongPressGestureRecognizer alloc] initWithTarget:sel ...
- nyoj 1036 非洲小孩【贪心区间选点】
非洲小孩 时间限制:1000 ms | 内存限制:65535 KB 难度:2 描述 家住非洲的小孩,都很黑.为什么呢?第一,他们地处热带,太阳辐射严重.第二,他们不经常洗澡.(常年缺水,怎么洗 ...
- hdoj 2502 月之数
月之数 Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submiss ...
- Unicode与 utf8的互相转换
<?php function unicode_encode($name) { $name = iconv('UTF-8', 'UCS-2', $name); $len = strlen($nam ...
- ASP.NET- web.config配置用户出错页
很简单,刚好用到,收藏 RemoteOnly是自定义用户错误,改成On,将所有错误都不让用户看见 每当用户访问错误页面时,会出现不友好的404错误,所以为了防止这种不友好,我们在web.config中 ...
- PostgreSQL9.5 新特性
PostgreSQL9.5 新特性 PostgreSQL9.5:Foreign Table Inheritance PostgreSQL9.5:Row-Level Security Policies ...
- WindowsService的调试方法
本人转载:http://www.cnblogs.com/xiebin1986/archive/2011/12/15/2288893.html 调试WindowsService,以前用过一个附加到进程的 ...
- ZBar只扫描二维码/条形码
You can add these codes for ImageScanner scanner.setConfig(0, Config.ENABLE, 0); //Disable all the S ...
- Sysinternals Suite实用程序工具包
Sysinternals Suite是微软出品的一套集成数十个绿色软件的实用程序工具包.就在2014年1月29日(官方日期),迎来了2014新版本 AccessChk为了确保创建安全的环境,Windo ...