<Script src = "/js/jquery-1.4.1.js" type = "text/javascript"> </script>
<Script type = "text/javascript">
Var pageindex = 1;
Var pagesize = 2;
$ (Function (){
Previous ();
})
Function previous (){
If (pageindex <1 | pageindex = 1 ){
Pageindex = 1;
$ ("# Imgdiv img: lt (" + pagesize + ")"). show ();
$ ("# Imgdiv img"). not ($ ("# imgdiv img: lt (" + pagesize + ")"). hide ();
}
Else {
Pageindex --;
If (pageindex! = 1 ){
$ ("# Imgdiv img: gt (" + (pageindex-1) * pagesize-1) + "): lt (" + pagesize + ")"). show ();
$ ("# Imgdiv img "). not ($ ("# imgdiv img: gt (" + (pageindex-1) * pagesize-1) + "): lt (" + pagesize + ")")). hide ();
}
If (pageindex = 1 ){
$ ("# Imgdiv img: lt (" + pagesize + ")"). show ();
$ ("# Imgdiv img"). not ($ ("# imgdiv img: lt (" + pagesize + ")"). hide ();
}
}
}
Function next (){
Var p = $ ("# imgdiv img"). length/pagesize;
Var pagecount = parseInt (Math. ceil (p ));
If (pageindex + 1> pagecount ){
Pageindex = pagecount;
} Else {
Pageindex ++;
}
$ ("# Imgdiv img: gt (" + (pageindex-1) * pagesize-1) + "): lt (" + pagesize + ")"). show ();
$ ("# Imgdiv img "). not ($ ("# imgdiv img: gt (" + (pageindex-1) * pagesize-1) + "): lt (" + pagesize + ")")). hide ();
}
</Script>
<Div>
<A href = "javascript: previous ()"> previous page </a>
<Div id = "imgdiv">
</Div>
<A href = "javascript: next ()"> next page </a>
</Div>
From the column zhangjf20120133