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.支付界面调通也相对 ...
随机推荐
- UWP开发:APP之间的数据交互(以微信为例)
目录 说明 UWP应用唤醒方式 跟微信APP交互数据 APP之间交互数据的前提 说明 我们经常看到,在手机上不需要退到桌面,APP之间就可以相互切换,并且可以传递数据.比如我在使用知乎APP的时候,需 ...
- TODO:一不顺眼就换字体Go之代码篇
TODO:一不顺眼就换字体Go之代码篇 image包实现了一个基本的2D图像库,该包中包含基本的接口叫做image,这个里面包含color,这个将在image/color中描述:新增字体font,进行 ...
- .Net 面试题 3C(CTS,CLS,CLR)
1.CTS(Common Type System)通用类型系统 CTS不但实现了COM的变量兼容类型,而且还定义了通过用户自定义类型的方式来进行类型扩展.任何以.NET平台作为目标的语言必须建立它的数 ...
- js连等赋值
引用:http://www.iteye.com/topic/785445 https://segmentfault.com/q/1010000002637728 这是一个问题 var a = {n:1 ...
- angular1
1.双向绑定: 可进可出 2.依赖注入 函数有定义方定义 3.MVC M: Model 模型--数据 V: View 视图--表现层 C: Controller 控制器--业务逻辑 4.模板: {{ ...
- IL指令详细表
名称 说明 Add 将两个值相加并将结果推送到计算堆栈上. Add.Ovf 将两个整数相加,执行溢出检查,并且将结果推送到计算堆栈上. Add.Ovf.Un 将两个无符号整数值相加,执行溢出检查,并且 ...
- javascript学习之BOM
BOM是browser object model的缩写,简称浏览器对象模型.先看看下面这张图 window对象是BOM的顶层(核心)对象,所有对象都是通过它延伸出来的,也可以称为window的子对象. ...
- MVC5 网站开发之二 创建项目
昨天对项目的思路大致理了一下,今天先把解决方案建立起来.整个解决包含Ninesky.Web.Ninesky.Core,Ninesky.DataLibrary等3个项目.Ninesky.Web是web应 ...
- chrome控制台模拟hover、focus、active等状态,方便调试
有时候需要调试一个网页,需要某些元素在hover.focus.active等状态. 比如hover,鼠标放到hover上,然后去控制台中找DOM,鼠标移开的时候元素就不是hover状态了. 此时可以使 ...
- AR创意分享:儿童涂鸦遇上程序绘图
第一节 临摹 小明经常临摹同桌小美的画作. 美术课上,老师表扬了小美的新作. 图1.1 小美的作品<蒙娜·毛虫的微笑> 临,是照着原作画:摹,是用薄纸张蒙在原作上面画. 第二节 借画 小明 ...