Paginathing.js jquery配置参数

HTML结构

<div class="panel panel-primary">
  <div class="panel-heading">
    <h3 class="panel-title">List of item.</h3>
  </div>
  <ul class="list-group">
    <li class="list-group-item"> Your Item 1</li>
    <li class="list-group-item"> Your Item 2</li>
    <li class="list-group-item"> Your Item 3</li>
    <li class="list-group-item"> Your Item 4</li>
    <li class="list-group-item"> Your Item 5</li>
    <li class="list-group-item"> Your Item 6</li>
  </ul>
</div>  

在页面中引入jquery和paginathing.js文件

<script src="js/jquery.min.js"></script>
<script src="js/paginathing.js.js"></script>

初始化插件

在页面DOM元素加载完毕之后,通过下面的方法来初始化该jquery分页插件。对无序列表进行分页,每页显示2条记录。

<script type="text/javascript">
  jQuery(document).ready(function($){
    $(‘.list-group‘).paginathing({
          perPage: 2,
          containerClass: ‘panel‘
    })
  });
</script>

JQuery

$(‘.infoUl‘).paginathing({
        perPage:20,
        firstText: ‘首页‘,
        lastText: ‘末页‘
    })

配置参数

perPage:10,                      //每页显示的记录数

limitPagination: false,        //可以是false或一个数值。用于限制分页的页码。.

prevNext: true,                  //是否允许显示前一页按钮。

firstLast: true,                   //是否允许显示第一页和最后一页按钮。

prevText: ‘?‘,                    //前一页按钮上显示的文字。

nextText: ‘?‘,                  //下一页按钮上显示的文字。

firstText: ‘First‘,              //第一页按钮上显示的文字。

lastText: ‘Last‘,               //最后一页按钮上显示的文字。

containerClass: ‘pagination-container‘,           //容器的class名称

ulClass: ‘pagination‘,          //ul元素的class名称

liClass: ‘page‘,                  //li元素的class名称

activeClass: ‘active‘,         //当前分页按钮的class名称

disabledClass: ‘disable‘      //被禁用的分页按钮的class名称

insertAfter: null                  //键分页传入到指定的元素之后,可以是null,或一个class名称,或一个id

pageNumbers: false          //显示总页数,limitPagination参数必须设置true。

分页样式(bootstrap样式)

.pagination {
    display: inline-block;
    padding-left: 0;
    margin: 20px 0;
    border-radius: 4px;
}
.pagination > li {
    display: inline;
}
.pagination > li > a,
.pagination > li > span {
    position: relative;
    /*float: left;*/
    padding: 6px 12px;
    margin-left: -1px;
    line-height: 1.42857143;
    color: #337ab7;
    text-decoration: none;
    background-color: #fff;
    border: 1px solid #ddd;
}
.pagination > li:first-child > a,
.pagination > li:first-child > span {
    margin-left: 0;
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}
.pagination > li:last-child > a,
.pagination > li:last-child > span {
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
}
.pagination > li > a:hover,
.pagination > li > span:hover,
.pagination > li > a:focus,
.pagination > li > span:focus {
    z-index: 2;
    color: #23527c;
    background-color: #eee;
    border-color: #ddd;
}
.pagination > .active > a,
.pagination > .active > span,
.pagination > .active > a:hover,
.pagination > .active > span:hover,
.pagination > .active > a:focus,
.pagination > .active > span:focus {
    z-index: 3;
    color: #fff;
    cursor: default;
    background-color: #337ab7;
    border-color: #337ab7;
}
.pagination > .disabled > span,
.pagination > .disabled > span:hover,
.pagination > .disabled > span:focus,
.pagination > .disabled > a,
.pagination > .disabled > a:hover,
.pagination > .disabled > a:focus {
    color: #777;
    cursor: not-allowed;
    background-color: #fff;
    border-color: #ddd;
}
.pagination-lg > li > a,
.pagination-lg > li > span {
    padding: 10px 16px;
    font-size: 18px;
    line-height: 1.3333333;
}
.pagination-lg > li:first-child > a,
.pagination-lg > li:first-child > span {
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
}
.pagination-lg > li:last-child > a,
.pagination-lg > li:last-child > span {
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
}
.pagination-sm > li > a,
.pagination-sm > li > span {
    padding: 5px 10px;
    font-size: 12px;
    line-height: 1.5;
}
.pagination-sm > li:first-child > a,
.pagination-sm > li:first-child > span {
    border-top-left-radius: 3px;
    border-bottom-left-radius: 3px;
}
.pagination-sm > li:last-child > a,
.pagination-sm > li:last-child > span {
    border-top-right-radius: 3px;
    border-bottom-right-radius: 3px;
}

原文地址:https://www.cnblogs.com/coldfishdt/p/9449446.html

时间: 2024-08-30 15:54:20

Paginathing.js jquery配置参数的相关文章

Thinkphp5中利用js/jQuery传递参数的方法

window.location.href="{:url('Index/index')}>"+"/ID/"+ID; //这样可以生成,但url模式改变则不能用 window.location.href="{:url('Index/index','ID=" + ID+ "')}" //解析不成功. window.location.href="{:url('Index/detail',['id' => &quo

jquery的uploadify插件多文件上传配置参数详解

最近做了个多文件上传,需要限制上传文件类型的例子.以前没做过找了一些资料,下次有用.同时也给大家做参考. uploader: uploadify.swf 文件的相对路径,该swf文件是一个带有文字BROWSE的按钮,点击后淡出打开文件对话框,默认值:uploadify.swf. script: 后台处理程序的相对路径 .默认值:uploadify.php checkScript:用来判断上传选择的文 件在服务器是否存在的后台处理程序的相对路径 fileDataName:设置一个名字,在服务器处理

js实现可配置参数的轮播图

一个轮播图做了一天多,期间各种小错误层出不穷,为自己的功力感到压力好大,却也在这艰难挣扎中体会了不少知识点,更加求知若渴. get到的点:js来添加.修改.去除css样式  对setTimeout 或setInterval 函数队列里事件的清除 1 var show = document.getElementById("show"); 2 var pic = show.getElementsByTagName('img'); 3 var timer; 4 var start_index

jquery.cookie.js 的配置

一个轻量级的cookie 插件,可以读取.写入.删除 cookie. 首先包含jQuery的库文件,在后面包含 jquery.cookie.js 的库文件. <script type="text/javascript" src="js/jquery-1.6.2.min.js"></script> <script type="text/javascript" src="js/jquery.cookie.js&

fullpage.js的easing参数怎样配置自定义动画

首先看非官方文档 并没有详细的说明怎样去使用easing.js,所以我加的运动属性根本就不起作用, 再看,官方文档 Optionally, when using css3:false, you can add the jQuery UI library in case you want to use other easing effects apart from the ones included in the jQuery library (linear and swing ) or the

fullpage.js 基本配置

1.fullpage地址 https://github.com/alvarotrigo/fullPage.js 2.fullpage基本配置 引入css文件和js文件 1 <script src="jquery.js"></script> 2 <script src="jquery.fullpage.js"></script> 3 <link rel="stylesheet" href=&qu

jquery datatable 参数api

jQuery 的插件 dataTables 是一个优秀的表格插件,提供了针对表格的排序.浏览器分页.服务器分页.筛选.格式化等功能.dataTables 的网站上也提供了大量的演示和详细的文档进行说明,为了方便学习使用,这里一步一步进行说明. 首先,需要到 dataTables 的网站 http://www.datatables.net/ 下载这个脚本库, 然后,在网页中先加入 jQuery 的引用,然后,加入 dataTables 的引用. 引入CSS文件和JS文件 -------------

jquery datatable 参数

jquery datatable 参数 DataTables(http://www.datatables.net/)应该是我到目前为止见过的,功能最强大的表格解决方案(当然,不计算其它整套框架中的table控件在内). 先把它主页上写的特性翻译罗列如下: 可变长度分页:动态过滤:多列排序,带数据类型检测功能:列宽度的智能处理:从多种数据源获取数据(DOM,js Array, ajax file, server-side returning):滚动配置属性:完整国际化支持: jquery UI T

[Js/Jquery]jquery插件开发

摘要 上篇文章简单学习了js自调用方法.今天就趁热打铁,学一学怎么编写一个jquery插件. JQuery 参考地址:http://www.cnblogs.com/playerlife/archive/2012/05/11/2495269.html 通过JQuery.fn增加一个新的函数来编写JQuery插件,也可以说是在Jquery对象上面扩展一个新的方法. 代码片段: jQuery.fn.myPluigin = function () { //code... }; 似乎这样就可以了,但有个问