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