<!--#include file="zheboconn.asp"-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>利用层实现具体新闻分页显示</title>
<style type="text/css">
<!--
#frameContent{
width:873px; /*调整显示区的宽*/
height:490px; /*调整显示区的高*/
font-size:14px;
line-height:20px;
overflow-y:hidden;
}
#apDiv1 {
position:absolute;
left:0px;
top:0px;
width:1024px;
height:768px;
z-index:1;
}
#apDiv2 {
position:absolute;
left:21px;
top:209px;
width:873px;
height:490px;
z-index:2;
}
.STYLE3 {
font-size: 15px;
font-family: "宋体";
color: #000000;
line-height:25px;
}
img{border:none}
-->
</style>
</head>
<body scroll="no" >
<div id="apDiv1"><img src="images/321.jpg" width="1024" height="768" border="0" />
</div>
<div id="pages" style="font-size:12px; position:absolute; Top:279px; left:902px; z-index: 1; width:auto; height:auto"></div>
<div id="apDiv2">
<div id="frameContent">
<table width="97%" border="0" align="center" scroll="no">
<tr>
<td height="35" valign="top">
<span class="STYLE3">
<%
id=cint(trim(replace(request("id"),"'","")))
strquery = "select * from 表名 where id="&id
set rs = conn.execute(strquery)
if not rs.bof then
%>
<br>
</span>
<table width="100%" height="26">
<%
do while not rs.eof
%>
<tr>
<td height="20" align="center" valign="middle" class="STYLE3"><strong><%=rs("title")%></strong></td>
</tr>
<tr> <td height="20" align="center" valign="middle" class="STYLE3">开始时间:<%=rs("starttime")%> 结束时间:<%=rs("endtime")%> </td></tr>
<tr> <td height="20" class="STYLE3"><%=rs("content")%></td>
</tr>
<%
rs.movenext
loop
%>
</table>
<span class="STYLE3">
<%
else
response.write("无数据.")
end if
rs.close
conn.close
set adodataconn = nothing
set rsemaildata = nothing
%>
</span></td>
</tr>
</table>
</div>
<P>
<script language="javascript">
var obj = document.getElementById("frameContent"); //获取内容层
var pages = document.getElementById("pages"); //获取翻页层
var pgindex=1;
var allp = 0;
window.onload = function() //重写窗体加载的事件
{
var allpages = Math.ceil(parseInt(obj.scrollHeight)/parseInt(obj. offsetHeight));//获取页面数量
allp = allpages;
// pages.innerHTML = "<b>共"+allpages+"页</b>"; //输出页面数量
for (var i=1;i<=allpages;i++){
// pages.innerHTML += "<a href=/"javascript:showPage('"+i+"');/">第"+i+"页</a> ";
//循环输出第几页
}
pages.innerHTML += " <a href=/"javascript:gotopage('-1');/" onFocus=this.blur()><img src=images/s1.gif border=0/></a></br></br></br></br></br></br><a href=/"notification.asp/" onFocus=this.blur()><img src=images/f1.gif border=0/></a></br></br></br></br></br></br><a href=/"javascript:gotopage('1');/" onFocus=this.blur()><img src=images/x.gif border=0/></a>"
}
function gotopage(value){
try{
value=="-1"?showPage(pgindex-1):showPage(pgindex+1);
}catch(e){
}
}
function showPage(pageINdex)
{
obj.scrollTop=(pageINdex-1)*parseInt(obj.offsetHeight); //根据高度,输出指定的页
pgindex=pageINdex;
//alert(allp);监听的弹出窗口,监听第几页
if(pgindex<1)
pgindex=1;
else if(pgindex >allp)
pgindex=allp;
}
</script>
</div>
</body>
</html>