GithubHelp home page GithubHelp logo

jquery.pager.js's Introduction

jquery.pager.js

轻量级的jquery分页插件

1、简单轻量的分页插件,源码不超过5kb

2、支持自定义按钮文字、页码链接

3、支持页面改变后的回调函数

基本使用

html

<div class="pager">
</div>

css

.pager { display: inline-block; font: 12 px/21px "宋体"; margin-top: 20px; }
    .pager a, .pager .flip, .pager .curPage { border: 1px solid #e3e3e3; display: inline-block; height: 22px; line-height: 22px; text-align: center; }
    .pager a { background: none repeat scroll 0 0 #fff; color: #010101; text-decoration: none; width: 26px; }
        .pager a:hover { background: none repeat scroll 0 0 #f1f1f1; }
    .pager .noPage { color: #a4a4a4; }
    .pager .curPage { background: none repeat scroll 0 0 #49abde; color: #ffffff; width: 26px; }
    .pager .flip { width: 56px; }

script

<script src="http://luopq.com/demo/lib/jquery-1.10.2.min.js"></script>
<script src="../src/jquery.pager.js"></script>
<script>
    var pager = $(".pager").pager();
</script>

Demo

1、Demo

Options

参数 类型 默认值 描述
pageIndex number 0 当前页码,0表示第一页
pageSize number 6 每页显示数量
itemCount number 50 显示项的总数量
maxButtonCount number 7 除去第一页和最后一页的最大按钮数量
prevText string "上一页" 上一页按钮显示的文字
nextText string "下一页" 下一页按钮显示的文字
buildPageUrl function null 构造页码按钮链接href的方法,包含一个pageIndex参数,不传则返回"javascript:;"
onPageChanged function null 页码修改后的回调函数,包含一个pageIndex参数

jquery.pager.js's People

Contributors

luopq avatar kugouming avatar richardchen85 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.