1. The pages on the home page, the last page, the previous page, and the next page (the first page is a fixed row, unchanged)
<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <HTML xmlns = "http://www.w3.org/1999/xhtml"> View code
2. pages on the home page, last page, previous page, and next page (no fixed Rows)
VaR totalpage = 1; // total number of pages
VaR currentpage = 1; // current page number
Gettackoutpage = function (PNO, psize) {var itable = document. getelementbyid ("tackoutsundryorderlist"); var Lis = itable. getelementsbytagname ("Li"); var num = Lis. length; // ul rows totalpage = 0; // total number of pages pagesize = psize; // The number of lines displayed on each page if (Num-1) /pagesize> = parseint (Num-1)/pagesize) {totalpage = parseint (Num-1)/pagesize) + 1 ;} else {totalpage = parseint (Num-1)/pagesize);} currentpa GE = PNO; // the current page number var startrow = (currentpage-1) * pagesize; // start to display the row var endrow = currentpage * pagesize; // end the row endrow = (endrow> num )? Num: endrow; For (VAR I = 0; I <num; I ++) {if (I> = startrow & I <endrow) {Lis [I]. style. display = 'block';} else {Lis [I]. style. display = 'none';} var pageend = document. getelementbyid ("tackoutendpage"); tackoutfirstpage. removeclass (); tackoutprevpage. removeclass (); tackoutnextpage. removeclass (); endpage. removeclass (); If (currentpage> 1) {tackoutfirstpage. ATTR ("disabled", false); tackoutfirstpage. addclass ("tackouthomepage");} else {tackoutfirstpage. ATTR ("disabled", true); tackoutfirstpage. addclass ("tackouthomepageunable");} If (currentpage> 1) {tackoutprevpage. ATTR ("disabled", false); tackoutprevpage. addclass ("tackoutprevpage");} else {tackoutprevpage. ATTR ("disabled", true); tackoutprevpage. addclass ("tackoutprevpageunable");} If (currentpage <totalpage) {tackoutnextpage. ATTR ("disabled", false); tackoutnextpage. addclass ("tackoutnextpage");} else {tackoutnextpage. ATTR ("disabled", true); tackoutnextpage. addclass ("tackoutnextpageunable");} If (currentpage <totalpage) {endpage. ATTR ("disabled", false); endpage. addclass ("tackoutendpage");} else {endpage. ATTR ("disabled", true); endpage. addclass ("tackoutendpageunable ");}};
// Click events on the homepage
Tackoutfirstpage. On ('click', function (){
Gettackoutpage (1, 8 );
});
// Click Event on the previous page
Tackoutprevpage. On ('click', function (){
Gettackoutpage (currentpage-1, 8 );
});
// Click events on the next page
Tackoutnextpage. On ('click', function (){
Gettackoutpage (currentpage + 1, 8 );
});
// Click Event on the last page
Endpage. On ('click', function (){
Gettackoutpage (totalpage, 8 );
});
3. pagination can have links to multiple pages
0001. Paging