这样的分页代码怎么写?
这样的分页代码怎么写?求高人指点一下。<script language="JavaScript" type="text/javascript">
var prestring = "http://fashion.zdface.com"
var urlstring = "/a/NewShow_"
var currentPage = 0
var prevPage = currentPage-1
var nextPage = currentPage+1
var countPage = 5
if(countPage>1&¤tPage!=0&¤tPage!=1)
document.write("<a href='" + prestring + urlstring + "1189695_1.htm'>首页</a> | <a href='" + prestring + urlstring + "1189695_"+ (prevPage +1)+ ".htm'>上一页</a> ");
else if(countPage>1&¤tPage!=0&¤tPage==1)
document.write("<a href='" + prestring + urlstring + "1189695_1.htm'>首页</a> | <a href='" + prestring + urlstring + "1189695_"+ (prevPage +1)+ ".htm'>上一页</a> ");
else
document.write("<a href='" + prestring + urlstring + "1189695_1.htm'>首页</a> | <a href='" + prestring + urlstring + "1189695_1.htm'>上一页</a> ");
var num = 5;
for(var i=0+(currentPage-1-(currentPage-1)%num) ; i<=(num+(currentPage-1-(currentPage-1)%num))&&(i<countPage) ; i++){
if(currentPage==i)
document.write("<a style=\"color:#fff; background:#333;\" href='" + prestring + urlstring +"1189695_"+(i+1)+".htm'>"+(i+1)+"</a> ");
else if(i==0){
document.write("<a href='" + prestring + urlstring + "1189695_1.htm'>"+1+"</a> ");
}else
document.write("<a href='" + prestring + urlstring + "1189695_" + (i + 1) + "." + "htm'>"+(i+1)+"</a> ");
}
if(countPage>1&¤tPage!=(countPage-1))
document.write("<a href='" + prestring + urlstring + "1189695_"+(nextPage+1)+ "."+"htm'>下一页</a> | <a href='" + prestring + urlstring + "1189695_"+countPage+ "."+"htm'>尾页</a> ");
else
document.write("<a href='" + prestring + urlstring + "1189695_1.htm'>下一页</a> | <a href='" + prestring + urlstring + "1189695_"+countPage + ".htm'>尾页</a> ");
</script>
这种分页目前只能通过插件来采集到 分页目前只能通过插件来采集到
页:
[1]