这几天刚好在用JAVA开发一个WEB应用系统,在前端的设计中涉及到分页问题,以下是本人在处理分页问题时总结出来的一个用JAVACRIPT控制的分页模式,总结了一下.这里需要用到一些图片,如果有需要的朋友可以给我发E-MAIL,我再将整个文件打包发给您.由于不是很复杂,所以这里就不做太多描述了。
/**
* 分页处理
*
Title: rj-page
*
Description: rj-page v1.0
*
Copyright: Copyright (c) 2004
*
Company: rjsoft
* @author thinker
* @email yanghuangming@rongji.com
* @version 1.0
*/
/**
*@pagcCount:总页数
*@currentPage:当前页码
*@url:分页URL
*@pageSize:每页显示页码数
*/
function page(pageCount,currentPage,url,pageSize){
//样式的初始化
var bgpic_no_repeat ='background-repeat:no-repeat;';
var page_num ='font-size: 9px;color: #999999;text-decoration: none;text-align: center;cursor: hand;vertical-align: top;';
var page_num_cur ='font-size: 9px;color: #ff0000;text-decoration: none;text-align: center;cursor: hand;vertical-align: top;';
//body区域
var first,last,numClass,pageId;
var showText ="";
showText +='
first = pageCount-pageSize+1;
}else{
first = currentPage;
}
if((first+pageSize)<=pageCount){
last = first+pageSize;
}else{
last = pageCount+1;
}
}else{
first = 1;
last = pageCount+1;
}
for(var k=first;k
showText+='
| '; showText+=' | Total:'+pageCount+' |
showText+=' ';showText+='
| '; if(currentPage>1){ pageId = currentPage-1; showText+=''; } showText+=' if(currentPage>1){ showText+=''; } showText+=' |
| '; showText+=' showText+=' |
| '; showText+=' showText+=' | '; showText+=' '+k+' '; showText+=' |
showText+='';}//循环结束//showText+='
| '; showText+=' |
showText+='';showText+='
| '; if(currentPage pageId=currentPage+1; showText+=' '; } showText+=' if(currentPage showText+=' '; } showText+=' |
document.write(showText);
}
博主用Java开发Web应用系统时,在前端设计遇到分页问题,总结出用JavaScript控制的分页模式。该模式涉及一些图片,若有需要可发邮件获取完整文件包,因不复杂未做过多描述。

1万+

被折叠的 条评论
为什么被折叠?



