Git Product home page Git Product logo

pagination's Introduction

原生js + 面向委托设计**编写的分页插件

演示:

image

说明

样式参考自 iview,代码命名参考自苏宁内部分页插件。
由于项目组技术栈略微老旧,采用的是 jq + fis3 + nginx 开发部署,刚去公司暂时没活不能闲着,想锻炼自己,同时也是由于前两天看了《你不知道的javascript》,知道了 面向委托 设计思路,觉得很有趣,便自己琢磨开发了下。

用法

  1. 引入 pagination.jspagination.css
  2. 取到需要插入分页的父元素
  3. 然后(js里面有注释):
pagination.init(
    container, // 需要插入分页的 父节点
    {
        count: 48, // 结果总数,必须要给,否则分页无效
        currentPage: 1, // 当前页,默认是第一页(可选)
        pageSizeTypes: [10, 20, 30, 40, 50], // “每页多少条”select框的可选项,默认是这5个(可选)
        callBack: null // 回调函数,默认跳转方法写在这里面(可选)
    })

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.