The first one: a very common and simple Display page page
Effect Chart:
• This is the HTML code, very simple (I seem to have seen the little eyes)
<! DOCTYPE html>
$ (function () {
var $table =$ (' table ');//Get Table Object
var currentpage=;//set the current page defaults to
var pagesize=;//set the number to display for each page
$table. Bind (' paging ', function () {
$table. Find (' tbody tr '). Hide (). Slice (Currentpage*pagesize, currentpage+) *pagesize). Show ();
Hide all the rows in the Tbody, and then show the data by slice combining the current number of pages and the numbers displayed on the page
});
var sumrows= $table. Find (' tbody tr '). length;//get Data
total
number of rows var sumpages=math.ceil (sumrows/pagesize); var $pager =$ (' <div class= ' page ' ></div> ');
for (var pageindex=;p ageindex<sumpages;pageindex++) {
$ (' <a href= ' # ' ><span> ' + (pageindex+) + ' </span></a> '). Bind ("click", {"NewPage":p ageindex},function (event) {
currentpage=event.data[) NewPage "];
$table. Trigger ("paging");
Add the trigger paging function} for each number of pages to be displayed
. appendto ($pager);
$pager. Append ("");
}
$pager. InsertAfter ($table);
$table. Trigger ("paging");
Second: Implementing the Forward and backward pages
Effect Chart:
• This is all code, with the original JS, still very simple drop (as if the native JS kind of inexplicable love, there are wood)