利用JScript对长篇文章进行分页
来源:互联网 发布:周末去哪儿 知乎 编辑:程序博客网 时间:2024/04/26 07:05
<table width="99%" border="0" align="right" cellpadding="0" cellspacing="0">
<tr>
<td height="25" align="right" bgcolor="#E5FDDF">发布时间:<%=rs("fbdate")%> 字体选择:【<a href="javascript:doZoom(16)" style="text-decoration: none;color:#000000">大</a>】【<a href="javascript:doZoom(14)" style="text-decoration: none;color:#000000">中</a>】【<a href="javascript:doZoom(12)" style="text-decoration: none;color:#000000">小</a>】【<a href="javascript:;" onClick="javascript:window.print()" style="text-decoration: none;color:#000000">打印】</a> 来源:<%=rs("source")%> 作者:<%=rs("author")%> </td>
</tr>
<tr>
<td id="zoom"></td>
</tr>
<tr>
<td height="25" id="page"></td>
</tr>
</table>
<%
dim content:content=rs("content")
set re=new RegExp
re.IgnoreCase=true
re.Global=True
re.Pattern="/<.*?>|<.*?>(.*?)<//.*?>|<.*?>/g"
content=re.Replace(content,"")
content=rePlace(rePlace(rePlace(rs("content").Value,"""","""),"'","'"),vbCrlf,"<br />") '这里搞死我了
%>
<SCRIPT LANGUAGE="JavaScript">
<!--
var content="<%=content%>"
function Perpage(content) { with (this)
{
this.content=content;
this.contentLength=content.length;
this.pageSizeCount;
this.perpageLength=null;
this.currentPage=1;
this.regularExp=//d+/;
this.S_content;
this.contentStyle=null;
this.scontent="";
this.content_id;
this.page_id="";
arguments.length==2?perpageLength=arguments[1]:'';
content_id=document.getElementById("page");
S_content=document.getElementById("zoom");
Perpage.initialize();
}};
Perpage.initialize=function() { with (this)
{
S_content.className=contentStyle!=null?contentStyle:"zoom";
if(contentLength<=perpageLength)
{
scontent=content;
S_content.innerHTML=scontent;
return null;
}
pageSizeCount=Math.ceil((contentLength/perpageLength));
Perpage.goto(currentPage);
Perpage.displayContent();
}};
Perpage.displayPage=function() { with (this)
{
page_id="";
if(currentPage&¤tPage!=1)
page_id+='<a href="javascript:void(0)" onclick="Perpage.previous()">上一页</a> ';
else
page_id+="上一页 ";
for(var i=1;i<=pageSizeCount;i++)
{
if(i!=currentPage)
page_id+='<a href="javascript:void(0)" onclick="Perpage.goto('+i+');">'+i+'</a> ';
else
page_id+='<font color="#FF6600"><b>'+i+'</b></font>'+" ";
}
if(currentPage&¤tPage!=pageSizeCount)
page_id+='<a href="javascript:void(0)" onclick="Perpage.next()">下一页</a> ';
else
page_id+="下一页 ";
page_id+="共 " + pageSizeCount + " 页";
content_id.innerHTML=page_id;
}};
Perpage.previous=function() { with(this)
{
Perpage.goto(currentPage-1);
}};
Perpage.next=function() { with(this)
{
Perpage.goto(currentPage+1);
}};
Perpage.goto=function(iCurrentPage) { with (this)
{
startime=new Date();
if(regularExp.test(iCurrentPage))
{
currentPage=iCurrentPage;
scontent=content.substr((currentPage-1)*perpageLength,perpageLength);
}
else
{
alert("page parameter error!");
}
Perpage.displayPage();
Perpage.displayContent();
}};
Perpage.displayContent=function() { with (this)
{
S_content.innerHTML=scontent;
}};
function doZoom(size){
document.getElementById('zoom').style.fontSize=size+'px'
}
Perpage(content,1100); //content为要显示的内容,1100为每页显示的字符串长度
//-->
</SCRIPT>
- 利用JScript对长篇文章进行分页
- 长篇文章的分页
- 长篇文章分页
- 长篇文章分页
- 用JS对长文章进行分页
- 用JS对长文章进行分页
- 利用sql对数据库进行分页
- 利用sql对数据库进行分页
- 利用 row_number 进行对传入SQL语句进行分页
- jscript分页
- 利用Apache工具和Guava对ArrayList进行分页
- 利用ListView进行分页
- 利用DB2进行分页
- 利用angularjs进行分页
- 利用bootstrap进行分页
- 对DataTable进行分页
- 对DataTable进行分页
- 对DataTable进行分页
- 用Visual C++ 5实现OpenGL编程
- 删除部分重复的记录,保留重复记录的第一条.
- 其他的一些生活小常识
- 常用的各种排序算法的JAVA实现
- ASP生成QQ在线(多个QQ用","隔开)
- 利用JScript对长篇文章进行分页
- 储过程(SQL2000)
- 家有妙招
- 快速排序算法的JAVA实现
- JavaScript按照MVC模式制作自定义控件(1)
- 希尔排序算法的JAVA实现
- 一个添加,修改,删除数据类,暂不支持二进制信息
- 插入排序算法的JAVA实现
- 使用ole中的Microsoft Date and time picker control来添加日期选择框