javascript下写的一个分页模板
2004-09-20 14:49
369 查看
这几天刚好在用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 +='
';
showText+=' '+k+' ';
showText+=' ';
showText+=' ';
showText+='';
showText+='';
}
//循环结束
//
showText+=' ';
showText+='
';
showText+='';
showText+=' ';
if(currentPagepageId=currentPage+1;
showText+='';
}
showText+='
';
if(currentPageshowText+='';
}
showText+='';
document.write(showText);
}
/**
* 分页处理
*
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 +='
'; 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+='
'; showText+=' '; showText+=' |
showText+='';
showText+=' ';
if(currentPagepageId=currentPage+1;
showText+='';
}
showText+='
';
if(currentPageshowText+='';
}
showText+='';
document.write(showText);
}
相关文章推荐
- javascript控件(二):一个好用的表格(分页实例)
- 只有20行Javascript代码!手把手教你写一个页面模板引擎
- 一个javascript模板的例子
- 使用javascript原生实现一个模板引擎
- 用 JavaScript 写 ASP,似乎很爽啊,自己封装了一个 操作数据库 分页 以及 文件操作的函数
- 只有20行Javascript代码!手把手教你写一个页面模板引擎
- 一个Javascript模板引擎的实现和优化
- 中级JavaScript例子, 如何实现一个简单实用的模板套用机制, GXTemplate , 第2章(估计要写9章)
- 只有20行Javascript代码!手把手教你写一个页面模板引擎
- Juicer – 一个Javascript模板引擎的实现和优化
- Juicer – 一个Javascript模板引擎的实现和优化
- 一个轻量级 Javascript 模板引擎 front.js【二】
- 教你使用javascript简单写一个页面模板引擎
- 【JavaScript】一个简单的分页,显示页首,中间页,页尾,当前页的前后三页,省略其它页
- 自己动手用Javascript写一个无刷新分页控件
- php初探: 一个简单的mysql数据库分页的程序模板
- 编写了一个支持firefox和ie的javascript+xml进行数据分页的程序
- 一个纯JavaScript分页源码插件
- java中显示列表有很多成型的组件,但我喜欢RICO一个开源的报表显示组件(javascript)的不分页显示
- 分享一个自己写的简单的javascript分页组件