This article mainly introduces Jquery simple paging implementation method. It provides examples to analyze jquery paging implementation techniques and provides some reference value, for more information about Jquery simple paging implementation, see the examples in this article. Share it with you for your reference. The details are as follows:
Js Code:
Function dolistpage (pagerow, pagenum, rowcount, pagecount) {$ ("# pagemsg" ).html ("display per page" + pagerow +, 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 "). cli Ck (function () {var tzys = $ ("# gpinput "). val (); var re =/^ [1-9] + [0-9] * $ /; if (tzys = null | tzys = undefined | tzys = '') {alert (" Enter the jump page number! "); $ (" # Gpinput "). focus (); return;} if (! Re. test (tzys) {alert ("enter the correct page number! "); $ (" # Gpinput "). focus (); return;} if (tzys> pagecount) tzys = pagecount; if (tzys <= 0) tzys = 1; loadtpage (tzys );}); $ ("# gpinput "). val (pagenum );}
HTML code:
Current 0/0 page JumpPage |
I hope this article will help you with jquery programming.