Encapsulated javascript front-end paging plug-in pagination and pagination Paging

Source: Internet
Author: User

Encapsulated javascript front-end paging plug-in pagination and pagination Paging

Abstract:
Recently, the front-end paging is used in the Development Project. It has been used before. To facilitate future use, it is encapsulated into a third-party plug-in without relying on any libraries. There are already many plug-ins on the Internet. What do you need to build your own wheels?

High scalability of Self-Writing
Independent from any database
As a technological accumulation

Let's take a look at it first.

Installation Method

First, we need to load css and js in the page.
<Link rel = "stylesheet" href = "dist/pagination.css">
<Script src = "dist/pagination. js"> </script>

Example

Pagination ({
Cur: 1, // current page number
Total: 6, // total number of pages
Len: 5, // how many pages are displayed
TargetId: 'pagination', // bind a paging Element
Callback: function (){
// Callback function
}
})

Parameter Introduction

Cur

Current page number. The current page is transferred each time.

Total

Total number of pages, which can be obtained based on the total number and the number displayed per page

Len

Quantity displayed on the page bar

TargetId

The

Callback

Functions executed after page rendering, such as event binding.

Tips
The demo uses static data. If you call the data on the server, you only need to change the for loop in the index. js file to an Ajax request.

Download http://xiazai.jb51.net/201601/yuanma/pagination-master (jb51.net.zip

Demo http://demo.jb51.net/js/2016/pagination-master/

Articles you may be interested in:
  • A very good JS paging effect code, worthy of Research
  • Js display div content by PAGE
  • Js table paging implementation code
  • Extjs learning notes 4 grid with paging
  • Sample Code displayed by JSP page
  • The JS paging control can be used for refreshing new pages.
  • Pure js paging code (concise and practical)
  • Sample Code for data list paging using jquery + json
  • Implementation Code of jsp paging display
  • Create html table paging example using js (implement paging using js)
  • Special effects of list paging in JavaScript
  • Use JQUERY paging control in ANGULARJS
  • JSP-implemented simple paging display effect code
  • Complete data paging method Example Using jsp + servlet + javabean

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.