CopyCode The 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>