JQ利用jPages.js实现完美分页

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd>
<html xmlns=http://www.w3.org/1999/xhtml>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>JQ利用jPages.js实现完美分页</title>
<script src="js/jQuery.1.8.2.min.js"></script>
<script src="js/jPages.js"></script>
<script>
    /* when document is ready */
    $(function(){
   
        /* initiate the plugin */
        $("div.holder").jPages({
            containerID  : "itemContainer",
   first: '首页',
   last: '尾页',
   previous: '上页',
   next: '下页',
   perPage: 1,
   startPage: 1,
   startRange: 2,
    midRange: 3,
    endRange: 2,
   animation: 'wobble',
   keyBrowse: true,
   callback    : function( pages, items){
      
      $("#page-panel").html("当前页面:" + pages.current);
      $("#page-pane2").html("页面总数:" + pages.count);
      $("#page-pane3").html("总数量:" + items.count);
       $("#page-pane4").html("每页数量:" + items.count/pages.count);


   }
        });
   
    });
</script>
 <style type="text/css">
  h2 a{
   color: #5DB0E6;
   text-shadow: 0 0 10px #5DB0E6;
  }
  
        .holder {
      margin: 15px 0;
   text-align:right;
     }
   
     .holder a {
      font-size: 14px;
      cursor: pointer;
      margin: 0 5px;
      color: #505050;
     }
   
     .holder a:hover {
      background-color: #222;
      color: #fff;
     }
   
     .holder a.jp-previous { margin-right: 15px; }
     .holder a.jp-next { margin-left: 15px; }
   
     .holder a.jp-current, a.jp-current:hover {
      color: #5DB0E6;
      font-weight: bold;
   text-shadow: 1px 1px #505050;
     }
   
     .holder a.jp-disabled, a.jp-disabled:hover {
      color: #bbb;
     }
   
     .holder a.jp-current, a.jp-current:hover,
     .holder a.jp-disabled, a.jp-disabled:hover {
      cursor: default;
      background: none;
     }
   
     .holder span { margin: 0 5px; }
 </style>

</head>

<body>
 <ul id="itemContainer">
 <li>2321321313123</li>
 <li>2321321313123</li>
 <li>2321321313123</li>
 <li>2321321313123</li>
 <li>2321321313123</li>
 
 
</ul>


<div class="holder" style="float:left"></div>
<div style="float:left;margin: 15px 2px;">
<span id="page-panel"></span>
<span id="page-pane2"></span>
<span id="page-pane3"></span>
<span id="page-pane4"></span>
</div>

 

</body>
</html>

完美下载地址:http://download.csdn.net/detail/niwsmbulai1989/6870449

演示地址:http://runjs.cn/detail/cdxfiez6

               http://sandbox.runjs.cn/show/cdxfiez6

转载于:https://my.oschina.net/u/1179405/blog/194722

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值