This example describes the jquery simple paging implementation. Share to everyone for your reference. Specifically as follows:
JS Code:
function Dolistpage (pagerow,pagenum,rowcount,pagecount) {$ ("#pagemsg"). HTML ("+pagerow+ per page" bar, current "+ Pagenum +"/"+
PageCount + "page Total" +rowcount + "Bar");
if (pagenum = = 1) {$ ("#fpbtn"). attr ("Disabled", true);
$ ("#rpbtn"). attr ("Disabled", true);
}else {$ ("#fpbtn"). Removeattr ("Disabled");
$ ("#rpbtn"). Removeattr ("Disabled");
} if (pagenum = = PageCount) {$ ("#npbtn"). attr ("Disabled", true);
$ ("#lpbtn"). attr ("Disabled", true);
}else {$ ("#npbtn"). Removeattr ("Disabled");
$ ("#lpbtn"). Removeattr ("Disabled");
$ ("#fpbtn"). Click (function () {loadtpage (1);
});
$ ("#rpbtn"). Click (function () {loadtpage (pagenum-1);
});
$ ("#npbtn"). Click (function () {if ((Pagenum + 1) >= PageCount) loadtpage (PageCount);
else Loadtpage (pagenum + 1);
});
$ ("#lpbtn"). Click (function () {loadtpage (PageCount);
});
$ ("#gpbtn"). Click (function () {var Tzys = $ ("#gpinput"). Val ();
var re =/^[1-9]+[0-9]*$/; if (Tzys = null | | tzys = = Undefined | | | tzys = = ") {AleRT ("Please enter the number of jump pages!");
$ ("#gpinput"). focus ();
Return
} if (!re.test (Tzys)) {alert ("Please enter the correct number of jump pages!");
$ ("#gpinput"). focus ();
Return
} if (Tzys > PageCount) Tzys = PageCount;
if (Tzys <= 0) Tzys = 1;
Loadtpage (Tzys);
});
$ ("#gpinput"). Val (Pagenum);
}
HTML code:
<table>
<tfoot>
<tr>
<td colspan= "One" >
<span class= " Water-table-listbtn "></span>
<span class=" Water-table-page ">
<span id=" pagemsg "class=" Water-table-pagemsg "> Current 0/0 page </span>
<input type=" button "id=" fpbtn "value=" Home "/>
<input Type= "button" id= "Rpbtn" value= "prev/> <input type=
" button "id=" Npbtn "value=" next page "/> <input type=
"Button" id= "Lpbtn" value= "last"/>
<span id= "pagemsg" class= "water-table-pagemsg" > Jump
<input Type= "text" id= "Gpinput" size= "3" value= "0"/> page
</span>
<input type= "button" id= "Gpbtn" value= " Jump "/>
</span>
</td>
</tr>
</tfoot>
</table>
I hope this article will help you with your jquery programming.