JQuery plugin ---- simplePagination.js API
CSS Themes
"light-theme"
"dark-theme"
"compact-theme"
How To Use
Step 1: together with JQuery, include jquery.simplePagination.js in your page:
<< span>scripttype="text/javascript"src="path_to/jquery.js"></>script><< span>scripttype="text/javascript"src="path_to/jquery.simplePagination.js"></>script>
</span></span>
JQuery 1.7.2 or later is recommended. Older versions might work as well, but they are not tested.
Step 2: OPTIONAL - include the CSS file with the 3 default themes
<< span>linktype="text/css"rel="stylesheet"href="path_to/simplePagination.css"/>
</span>
If you skip this step, you will need to define your own styles or use Bootstrap.
Step 3: call the function on your pagination placeholder:
$(function(){ $(selector).pagination({items:100,itemsOnPage:10,cssStyle:'light-theme'});});
If necessary, you can specify the number of pages directly, via "pages" parameter, instead of "items" and "itemsOnPage" which are used by the plugin to automatically calculate the number of pages.
Available options
items | Integer | Default: 1 | Total number of items that will be used to calculate the pages. |
itemsOnPage | Integer | Default: 1 | Number of items displayed on each page. |
pages | Integer | Optional | If specified, items and itemsOnPage will not be used to calculate the number of pages. |
displayedPages | Integer | Default: 5 | How many page numbers should be visible while navigating. Minimum allowed: 3 (previous, current & next) |
edges | Integer | Default: 2 | How many page numbers are visible at the beginning/ending of the pagination. |
currentPage | Integer | Default: 1 | Which page will be selected immediately after init. |
hrefTextPrefix | String | Default: "#page-" | A string used to build the href attribute, added before the page number. |
hrefTextSuffix | String | Default: empty string | Another string used to build the href attribute, added after the page number. |
prevText | String | Default: "Prev" | Text to be display on the previous button. |
nextText | String | Default: "Next" | Text to be display on the next button. |
labelMap | Array | Default: empty array | A collection of labels that will be used to render the pagination items, replacing the numbers. |
ellipsePageSet | Boolean | Default: true | When this option is true, clicking on the ellipse will replace the ellipse with a number type input in which you can manually set the resulting page. |
cssStyle | String | Default: "light-theme" | The class of the CSS theme. |
selectOnClick | Boolean | Default: true | Set to false if you don't want to select the page immediately after click. |
onPageClick(pageNumber, event) | Function | Optional | Function to call when a page is clicked. Page number and event are optional parameters. |
onInit | Function | Optional | Function to call when the pagination is initialized. |
Available methods
selectPage - Select a page based on page number.
$(function(){ $(selector).pagination('selectPage',pageNumber);});
prevPage - Selects the previous page.
$(function(){ $(selector).pagination('prevPage');});
nextPage - Select the next page.
$(function(){ $(selector).pagination('nextPage');});
getPagesCount - Returns the total number of pages.
$(function(){ $(selector).pagination('getPagesCount');});
getCurrentPage - Returns the current page number.
$(function(){ $(selector).pagination('getCurrentPage');});
disable - Disables pagination functionality.
$(function(){ $(selector).pagination('disable');});
enable - Enables the pagination after it was previously disabled.
$(function(){ $(selector).pagination('enable');});
destroy - Visually destroys the pagination, any existing settings are kept.
$(function(){ $(selector).pagination('destroy');});
redraw - The pagination is drawn again using the existing settings. (useful after you have destroyed a pagination for example)
$(function(){ $(selector).pagination('redraw');});
updateItems - allows to dynamically change how many items are rendered by the pagination
$(function(){ $(selector).pagination('updateItems',100);});
updateItemsOnPage - allows to dynamically change how many items are rendered on each page
$(function(){ $(selector).pagination('updateItemsOnPage',20);});
drawPage - takes a page number as a parameter and it sets the "currentPage" value to the given page number and draws the pagination
$(function(){ $(selector).pagination('drawPage',5);});JQuery plugin ---- simplePagination.js API
JQuery plugin ---- simplePagination.js API的更多相关文章
- jquery dataTables.min.js API
demo: http://datatables.net/release-datatables/examples/api/select_single_row.html 选择一行http://datata ...
- 分页插件jquery.simplePagination.js使用
利用ecshop后台,利用插件更改分页显示样式遇到的问题,由于是利用Ajax获取数据进行页面数据更新?所以出现了以下情况: 初始化页面前 : 分页更新后: 点击后出现了分页插件内容消失, 原因:分页一 ...
- jQuery plugin: Autocomplete 参数及实例
官网:jQuery plugin: Autocomplete (注:此插件已经不再更新.它的继任者是jQuery UI的一部分,) 此插件依赖于 jquery 1.2.6 --- j ...
- JQuery Plugin 开发
学习 JQuery 插件开发之后, 可以将自己平时常用的功能封装成插件, 便于在不同的项目之间使用. JQuery 官网上的 插件开发教程就很不错, 简单易懂. 参考网址: http://learn. ...
- js 图片处理 Jcrop.js API
引入jquery.Jcrop.min.css和jquery.Jcrop.min.js 参数/接口说明 options 参数说明 名称 默认值 说明 allowSelect true 允许新选框 all ...
- jQuery 关于ScrollableGridPlugin.js(固定表头)插件的逐步解析
以前写前台的时候需要用哪些效果从来都是有现成的东西拿来就用的,因为自己真的是有些懒,毫无探索精神,只重视结果,不追求过程. 这个ScrollableGridPlugin.js是从网上找到的一个具有固定 ...
- jQuery plugin : jqTransform
Usage 1- Add javascript inclusion in the header section of your web page //required <script type= ...
- [jQuery] 自做 jQuery Plugin - Part 1
有時候寫 jQuery 時,常會發現一些簡單的效果可以重複利用.只是每次用 Copy & Paste 大法似乎不是件好事,有沒有什麼方法可以讓我們把這些效果用到其他地方呢? 沒錯,就是用 jQ ...
- 怎样调通微信支付及微信发货通知接口(Js API)
怎样调通微信支付及微信发货通知接口(Js API) 微信支付提供了一个支付測试页面,微信支付正式使用须要測通支付.发货通知接口 .告警接口.维权接口.告警接口.维权接口非常easy.支付界面调通也相对 ...
随机推荐
- zerojs! 造出最好的 CMS 轮子
zerojs是一个基于nodejs.angularjs.git的CMS.在它之上可以继续开发出博客.论坛.wiki等类似的内容管理型系统. 拥抱开发者和社区 层次清晰,高度解耦.前后端即使分开也都是完 ...
- jQuery +ajax +json+实现分页
正文 首先我们创建一般处理程序,来读取数据库中内容,得到返回值. 创建文件,GetData.ashx. 我这里是用的存储过程,存储过程会再下面粘出来,至于数据只是实例,你们可根据需求自行读取数据 代码 ...
- Spring学习记录(十四)---JDBC基本操作
先看一些定义: 在Spring JDBC模块中,所有的类可以被分到四个单独的包:1.core即核心包,它包含了JDBC的核心功能.此包内有很多重要的类,包括:JdbcTemplate类.SimpleJ ...
- Hawk 1.2 快速入门2 (大众点评18万美食数据)
本文将讲解通过本软件,获取大众点评的所有美食数据,可选择任一城市,也可以很方便地修改成获取其他生活门类信息的爬虫. 本文将省略原理,一步步地介绍如何在20分钟内完成爬虫的设计,基本不需要编程,还能自动 ...
- ENGLISH抠脚童鞋的福利--GitHub汉化插件
今天在某前端群看到一个插件,激动万分啊!我就把插件使用实现的步骤分享一下! 打开chrome浏览器输入地址:chrome://extensions/ : 跳转到其他页面,点击左上角--扩展程序: 将T ...
- Python爬虫小白入门(一)写在前面
一.前言 你是不是在为想收集数据而不知道如何收集而着急? 你是不是在为想学习爬虫而找不到一个专门为小白写的教程而烦恼? Bingo! 你没有看错,这就是专门面向小白学习爬虫而写的!我会采用实例的方式, ...
- WCF备忘录一:服务端实例的生命周期
示例代码下载地址:WCFDemo1Day 概述 客户端向WCF服务发出请求后,服务端会实例化一个Service对象(实现了契约接口的对象)用来处理请求,实例化Service对象以及维护其生命周期的方式 ...
- CentOS 6.2 Eclipse CDT 开发环境搭建
一.安装中文语言支撑 我当初安装CentOS6.2时选择了中文语言支持,有iBus和拼音输入法,有gnome和kde 没有安装的可以参考:CentOS英文环境下使用中文输入法 安装中文语言支持和输入 ...
- 随机数(random)
需求 Random rd=new Random(); 需要十以内的随机数 (0---10) System.out.println((int)((rd.nextDouble()*100)/10)); ...
- Java - I/O
File类 java.io 操作文件和目录,与平台无关.具体的常用实例方法: File file = new File("."); // 以当前路径创建名为 ".&quo ...