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 项目的用户体验有了极大的提高,如今借助优秀的 ...
随机推荐
- 各个平台 如何安装 Ruby 和 RubyGems
原文地址:http://cloudfoundry-doc.csdn.net/frameworks/ruby/installing-ruby.html Last Updated: 2012-11-01 ...
- poj 2932 Coneology(扫描线+set)
Coneology Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 3574 Accepted: 680 Descript ...
- 深入理解 Spring 事务原理
本文由码农网 – 吴极心原创,转载请看清文末的转载要求,欢迎参与我们的付费投稿计划! 一.事务的基本原理 Spring事务的本质其实就是数据库对事务的支持,没有数据库的事务支持,spring是无法提供 ...
- SpringMVC 测试 mockMVC
SpringMVC测试框架 基于RESTful风格的SpringMVC的测试,我们可以测试完整的Spring MVC流程,即从URL请求到控制器处理,再到视图渲染都可以测试. 一 MockMvcBui ...
- SQLServer加入域后无法远程连接
如果您更改的SQLServer的远程连接端口(默认1433),加入域后,防火墙会把自定义规则都禁用掉 所以,你得进防火墙,查看,是否防火墙关闭了,我的就是关闭了,找了半天原因
- thinkphp如何写find_in_set这样的orm查询封装
今天写thinkphp的orm封装的时候 需要写一个 select * from table where user_id=xxx and find_in_set(100,group_id)这样的SQL ...
- IIS- ASP站点布署时查看ASP错误信息
ASP使用的脚本是VBSCRIPT,布置的时候想显示他的错误信息,可以在INTERNET选项里把显示友好http错误信息的勾去掉 就能查看ASP布署时查看错误信息的勾去掉.
- Creating custom datatypes using the umbraco usercontrol wrapper
本篇文章介绍的是基于UmbracoCMS技术搭建的网站所使用的相关技术. 1. 需求 Umbraco CMS的dataType中有richTexhEditor控件,但是它不是太完善,比如没有 ...
- [Webpack 2] Hashing with Webpack for long term caching
Leveraging the browser cache is an important part of page load performance. A great way to utilize t ...
- careercup-数组和字符串1.3
1.3 给定两个字符串,请编写程序,确定其中一个字符串的字符重新排序后,能否变成另一个字符串. C++实现代码: #include<iostream> #include<map> ...