The JS code is as follows:
Copy the Code code as follows:
Maximum data volume
var total= "100";
The amount of display per page
var pagesize=10;
How many pages are there?
var pagenum=math.ceil (total/pagesize);
Build navigation
function Initpage (nowpage) {
var pagenav= ' previous page ';
for (i=1;i<=pagenum;i++) {
Pagenav + = (i==nowpage)? ' ' + i + '': ' + i + ';
}
Pagenav + = ' next page ';
document.getElementById (' pages '). Innerhtml=pagenav;
}
Page
function GoToPage (page) {
var start= (page-1) *pagesize;
var max=page*pagesize;
for (Vs=0;vs
Varōbj=document.getelementbyid (' item_ ' + vs);
Obj.style.display= "None";
}
if (max>total) max=total;
for (v=start;v
Varōbj=document.getelementbyid (' item_ ' + V);
obj.style.display= "Block";
}
Initpage (page);
}
Previous page
function up (nowpage) {
if (nowpage==1) return false;
if (nowpage>1) goToPage ((nowpage-1));
}
Next page
function down (nowpage) {
if (Nowpage==pagenum) return false;
if (nowpage
}
If the data is
.........
.........
...........
........
Then you can show a navigation similar to this:
Prev 1 2 3 4 next page
Then click on the page or the upper and lower pages to toggle the display.
Time is quite hasty, say so many, everybody own analysis code, have not understood please message
The above describes the ListView page JS implementation of PHP pseudo-page, including the ListView page content, I hope the PHP tutorial interested in a friend helpful.