True page of the word to the program apes, not a strange vocabulary, but if you are the first to learn true pagination, perhaps it will take a little time to study, the following is to the turntable network (like can see, can also enter the engine mode) of the True page JS part of the code, the HTML part of the I will not write, A little bit of code can be used, you can also be flexible according to needs, do not lazy oh, nonsense not to say, directly on the code:
Functions Get_param (param) {//This function is used to get the parameters of the URL
var query = location.search.substring (1). Split (' & ');
for (Var i=0;i<query.length;i++) {
var kv = query[i].split (' = ');
if (kv[0] = = param) {
return kv[1];
}
}
return null;
}
$ ("#page_down"). Unbind (). bind (' click ', function () {//PAGE Down
Temp=get_param ("CurrentPage");
if (Temp==null | | IsNaN (TEMP)) {//non-numeric or no page number
topage=1;
}
else{
Topage=parseint (temp) +1;
}
ifnull=$ ("#ifnull"). attr ("value");
if (ifnull.length<3) {
topage=1;
}
Url= "${pagecontext.request.contextpath}/funnypic.do?currentpage=" +topage;
Window.location.replace (URL);
});
$ ("#home"). Unbind (). bind (' click ', function () {//Return to home page
Url= "${pagecontext.request.contextpath}/funnypic.do?currentpage=1";
Window.location.replace (URL);
});
$ ("#page_up"). Unbind (). bind (' click ', function () {//PAGE UP
Temp=get_param ("CurrentPage");
if (Temp==null | | IsNaN (TEMP)) {//non-numeric or no page number
topage=1;
}
else{
Topage=parseint (temp)-1;
}
if (topage<1) {
ShowMessage ("Pro ~ First page, really do not know where to go");
Return
}
ifnull=$ ("#ifnull"). attr ("value");
if (ifnull.length<3) {
topage=1;
}
Url= "${pagecontext.request.contextpath}/index.do?currentpage=" +topage;
Window.location.replace (URL);
});
$ (". Turnpage"). Unbind (). bind (' click ', function () {//Page Turn section code
Topage=parseint ($ (this). Text () + "");
ifnull=$ ("#ifnull"). attr ("value");
if (ifnull.length<3) {
topage=1;
}
Url= "${pagecontext.request.contextpath}/funnypic.do?currentpage=" +topage;
Window.location.replace (URL);
});
Website true page JS code how to write?