Code Monkey home page Code Monkey logo

pager's Introduction

pager

arguments:

/**
 *  pContainer:   {Element|String}    // 参数:分页组件容器或其选择器(必选)。
 *  conTotalCount {Number}         // 参数:页面内容条目总数量,用于计算页码(必选)
 *  onIndexChange {Function}       // 参数:页码切换回调函数(必选)被调用时携带参数:(构造好的页签数据对象,事件)。
 *  conPerPage {Number}            // 参数:每页内容条目数量,用于计算页码(可选,默认为页面内容条目总数量)。
 *  pMaxCount {Number}             // 参数:要显示页签的最大数量(可选,默认显示全部页签;请参阅下文附加说明)。
 *  curIndex {Number}              // 参数:默认设置为“当前页”的页码值(可选,默认为1)。
 *  @return {Object}               // 返回:基础分页组件对象。
 */

example:

var pager = new Pager({
    pContainer: '#pager',
    conTotalCount: pCount,
    onIndexChange: function (curIndex) {
        location.href = '/?page=' + curIndex;
    },
    conPerPage: 5,
    pMaxCount: 11,
    curIndex: 1
});

demo:

预览

pager's People

Watchers

 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.