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的更多相关文章

  1. jquery dataTables.min.js API

    demo: http://datatables.net/release-datatables/examples/api/select_single_row.html 选择一行http://datata ...

  2. 分页插件jquery.simplePagination.js使用

    利用ecshop后台,利用插件更改分页显示样式遇到的问题,由于是利用Ajax获取数据进行页面数据更新?所以出现了以下情况: 初始化页面前 : 分页更新后: 点击后出现了分页插件内容消失, 原因:分页一 ...

  3. jQuery plugin: Autocomplete 参数及实例

    官网:jQuery plugin: Autocomplete          (注:此插件已经不再更新.它的继任者是jQuery UI的一部分,) 此插件依赖于 jquery 1.2.6 --- j ...

  4. JQuery Plugin 开发

    学习 JQuery 插件开发之后, 可以将自己平时常用的功能封装成插件, 便于在不同的项目之间使用. JQuery 官网上的 插件开发教程就很不错, 简单易懂. 参考网址: http://learn. ...

  5. js 图片处理 Jcrop.js API

    引入jquery.Jcrop.min.css和jquery.Jcrop.min.js 参数/接口说明 options 参数说明 名称 默认值 说明 allowSelect true 允许新选框 all ...

  6. jQuery 关于ScrollableGridPlugin.js(固定表头)插件的逐步解析

    以前写前台的时候需要用哪些效果从来都是有现成的东西拿来就用的,因为自己真的是有些懒,毫无探索精神,只重视结果,不追求过程. 这个ScrollableGridPlugin.js是从网上找到的一个具有固定 ...

  7. jQuery plugin : jqTransform

    Usage 1- Add javascript inclusion in the header section of your web page //required <script type= ...

  8. [jQuery] 自做 jQuery Plugin - Part 1

    有時候寫 jQuery 時,常會發現一些簡單的效果可以重複利用.只是每次用 Copy & Paste 大法似乎不是件好事,有沒有什麼方法可以讓我們把這些效果用到其他地方呢? 沒錯,就是用 jQ ...

  9. 怎样调通微信支付及微信发货通知接口(Js API)

    怎样调通微信支付及微信发货通知接口(Js API) 微信支付提供了一个支付測试页面,微信支付正式使用须要測通支付.发货通知接口 .告警接口.维权接口.告警接口.维权接口非常easy.支付界面调通也相对 ...

随机推荐

  1. 分享一个CQRS/ES架构中基于写文件的EventStore的设计思路

    最近打算用C#实现一个基于文件的EventStore. 什么是EventStore 关于什么是EventStore,如果还不清楚的朋友可以去了解下CQRS/Event Sourcing这种架构,我博客 ...

  2. Windows 2008 R2 安装sp1时未知错误的解决办法

    最近在为Windows Server 2008 R2 打sp1补丁时出现“发生未知错误”,详细信息错误:0x800f0818: google后找到解决问题步骤,参照:http://www.wikiho ...

  3. Entity Framework 6 Recipes 2nd Edition(10-8)译 - >映射插入、修改、删除操作到存储过程

    10-8. 映射插入.修改.删除操作到存储过程 问题 想要映射插入.修改.删除操作到存储过程 解决方案 假设已有运动员实体模型,如Figure 10-8所示. 对应的数据库表如Figure 10-9所 ...

  4. hibernate一对一外键双向关联

    关联是类(类的实例)之间的关系,表示有意义和值得关注的连接. 本系列将介绍Hibernate中主要的几种关联映射 Hibernate一对一主键单向关联Hibernate一对一主键双向关联Hiberna ...

  5. VirtualBox 桥接上网方式的配置

    最近在搞Redis所以装了个virtualbox的ubuntu的虚拟机, redis不是在ubuntu上. 因为需要使用本机客户端访问redis服务,所以需要配置虚拟机和本地机器的双向访问,所以就用到 ...

  6. Winform下CefSharp的引用、配置、实例与报错排除(源码)

    Winform下CefSharp的引用.配置.实例与报错排除 本文详细介绍了CefSharp在vs2013..net4.0环境下,创建Winfrom项目.引用CefSharp的方法,演示了winfro ...

  7. 4. SVM分类器求解(2)

    最优间隔分类器(optimal margin classifier) 重新回到SVM的优化问题: 我们将约束条件改写为: 从KKT条件得知只有函数间隔是1(离超平面最近的点)的线性约束式前面的系数,也 ...

  8. putty无密码登陆

    1.打开puttygen.exe,点击Generate,然后按照说明用鼠标在空白处移动,生成密钥对.   2.保存私钥,不填passphrase.同时保存公钥,并打开公钥文件,将回车符去掉. 3.将公 ...

  9. JavaScript事件概览

    JavaScript事件 JavaScript是单线程,在同一个时间点,不可能同时运行两个"控制线程". 事件句柄和事件对象 1.注册事件句柄 标准和非标准 var button= ...

  10. Oracle 集群】ORACLE DATABASE 11G RAC 知识图文详细教程之ORACLE集群概念和原理(二)

    ORACLE集群概念和原理(二) 概述:写下本文档的初衷和动力,来源于上篇的<oracle基本操作手册>.oracle基本操作手册是作者研一假期对oracle基础知识学习的汇总.然后形成体 ...