Copy codeThe Code is as follows:
<Table height = "120" border = "0" align = "center" cellpadding = "5" cellspacing = "0">
<Script language = "javascript" type = "text/javascript">
Function int (I, k)
{
// Define variable
Var ff = 0;
Var j;
J = Math. round (I/k)-I/k;
If (j! = 0 ){
Ff = Math. round (I/k) + 1 ;}
Else
{
Ff = Math. round (I/k );
}
Return ff;
}
Function querystring (qs ){
S = location. href;
S = s. replace ("? ","? & "). Split ("&");
Re = "";
For (I = 1; I <s. length; I ++ ){
If (s [I]. indexOf (qs + "=") = 0 ){
Re = s [I]. replace (qs + "= ","");
}
}
Return re;
}
Var page = querystring ("page ")
If (page = false ){
Page = 1
}
Var maxperpage = 4 // The number of entries per page. Four entries per page are displayed.
Var totalimg = 8 // a total of 8 Images
Var filename = "list.htm" // name of the file
Var pagecounts
Var cnum, snum, onum, endnum, kstr
Var startnum = (page-1) * maxperpage );
Endnum = startnum + maxperpage;
Var x = 0;
Pagecounts = int (totalimg, maxperpage)
If (page = pagecounts ){
Endnum = (pagecounts-1) * maxperpage) + totalimg-(pagecounts-1) * maxperpage
}
For (k = startnum + 1; k <= endnum; k ++ ){
Kstr = k. toString ();
If (k <10 ){
Kstr = "00" + kstr
}
Else
{
Kstr = "0" + kstr
}
X + = 1;
// Display data
If (x % 2 = 0 ){
Document. write ("<td> </td> </tr> ");
} Else {
Document. write ("<tr> <td> </td> ");
}
}
</Script>
</Table> <table width = "100%" height = "23" border = "0" cellpadding = "0" cellspacing = "0">
<Tr>
<Td> <label>
<Div align = center> <span id = "dinfo"> </span> <select name = "select" onChange = "location. href = this. options [this. selectedIndex]. value ">
<Script type = "text/javascript" language = "javascript">
Document. getElementById ("dinfo "). innerHTML = "Total <font color = red>" + totalimg. toString () + "</font> total records <font color = red>" + pagecounts + "</font> page <font color = red>" + maxperpage + "</ font> entries ";
For (y = 1; y <= pagecounts; y ++ ){
If (page = y ){
Document. write ("<option value =" + filename + "? Page = "+ y +" selected> "+ y +" </option> ");
} Else {
Document. write ("<option value =" + filename + "? Page = "+ y +"> "+ y +" </option> ");
}
}
</Script>
</Select> </div>
</Label> </td>
</Tr>
</Table>