Giter Site home page Giter Site logo

pagination's Introduction

pagination

Pagination is a front page plugin, do not rely on any JS Library. Support es6 paginationEs6.js
demo

Install

  • in your html, you just do like this
<link rel="stylesheet" href="dist/pagination.css">
<script src="dist/pagination.js"></script>     
  • or you use requireJs
    define(["pagination"], function () { // your code });
  • or maybe you use seaJs
    seaJs.use('pagination');

example

pagination({
	cur: 1,     // 当前页数    
	total: 6,        // 总共多少页   
	len: 5,          // 分页显示多少     
	targetId: 'pagination', // 分页元素绑定     
	callback: function() {    
		// 回调函数   
	}   
})   

options

cur

当前页数,每次调用传递当前分页

total

总共多少页,根据总数和每页显示数量可以获取

len

分页栏上显示的数量

targetId

分页元素绑定的

callback

页面渲染完成之后执行的函数,比如事件绑定等。

tips

demo是用的静态数据,如果调用服务端的数据,只需将index.js文件中的for循环改成Ajax请求就可以了。

pagination's People

Contributors

siliushi avatar

Stargazers

空山少主 avatar tonylemon avatar michaelHan avatar  avatar Xiaobin Zhang avatar 方志青 avatar Monty avatar

Watchers

4j0 avatar  avatar

pagination's Issues

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.