主题:[讨论]如何实现公告栏向上滚动和留言板向上滚动效果
我首页的程序如下,想实现如何实现公告栏向上滚动和留言板向上滚动效果,应该在哪里加什么代码好呢?
<style type="text/css">
img {border:0px;}
</style>
</head>
<%
function cutstr(tempstr,tempwid)
if len(tempstr)>tempwid then
cutstr=left(tempstr,tempwid)&"..."
else
cutstr=tempstr
end if
end function
%>
<%
function cutstr2(tempstr2,tempwid2)
if len(tempstr2)>tempwid2 then
cutstr2=left(tempstr2,tempwid2)
else
cutstr2=tempstr2
end if
end function
%>
<link href="css/css.css" rel="stylesheet" type="text/css">
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
<script language="javascript" src="../js/jquery.js"></script>
<script language="javascript" src="js/thickbox.js"></script>
<script language="javascript" src="../js/jquery.form.js"></script>
<script language="javascript" type="text/javascript">
$(function(){
$("#user_login").click(function(){
var user_name=$("#user_name").val();
var user_key=$("#user_key").val();
if (user_name==""){
alert("请输入用户名!")
$("#user_name").focus();
return false;
}
if (user_key==""){
alert("请输入密码!")
$("#user_key").focus();
return false;
}
else{
$("#user_load").ajaxForm(function(S){
if(S.search("成功")>0){
alert("登入成功!");
location.href="index.asp";
}else
{
alert(S);
$("#Key_Word").val("");
$("#SafeCode").val("");
return false;
}
})
}
})
})
</script>
<script language="JavaScript">
function Wmaplay(id){ //排行榜目标
window.open( 'playrm.asp?id='+id,'cnmusiclisten', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=452,height=490,top=200,left=200');
}
function lbsong() //联播目标
{
window.open("about:blank","lbsong","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,top=200,left=200,width=452,height=450");
}
</script>
</head>
<body>
y
<!--LOGO-->
<div class="bg_top">
<div style="float:left;"><img src="images/lh/top_img1.gif" width="444" height="98" /></div>
</div>
<!--导航-->
<div class="daohang">
<div style=" float:left; background:#2A87E6"><img src="images/gaiban/dh_03.jpg" width="9" height="32" /></div>
<a href="index.asp"><div style="float:left" class="dh_di2">首页</div></a>
<div style="float:left; height:32px;">
<ul class="dh_di">
<li><a href="kecheng.asp" class="bai2">网上课堂</a></li>
<li><a href="download.asp" class="bai2">资料下载</a></li>
<li><a href="shipin.asp" class="bai2">教学视频</a></li>
<li><a href="text.asp" class="bai2">在线测试</a></li>
<li><a href="liuyan.asp" class="bai2">留言版</a></li>
<li><a href="user_zc.asp" class="bai2">注册</a></li>
<li><a href="../admin/login.html" class="bai2">管理员登录</a></li>
</ul>
</div>
<div style="float:right; background:#2A87E6"><img src="images/lh/dh_07.jpg" width="10" height="32" /></div>
</div>
<!--banner-->
<div class="banner">
<div class="flash">
<div style="margin:0px; border:0px; float:inherit; margin-left:0; padding-left:0">
<table width="655" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td> <div id=oTransContainer
style="FILTER: progid:DXImageTransform.Microsoft.Wipe(GradientSize=1.0,wipeStyle=0, motion='forward'); WIDTH: 655px; HEIGHT: 137px"><a href="index.asp" target="_blank"><a href="index.asp" target="_blank"><a href="index.asp" target="_blank"></a><a href="index.asp" target="_blank"><img class=pic id=oDIV1 src="image/01.jpg" width=655 height=137 /></a>
<script>var NowFrame = 1;var MaxFrame = 5;var bStart = 0;function fnToggle(){var next = NowFrame + 1;if(next == MaxFrame+1) {NowFrame = MaxFrame;next = 1;}if(bStart == 0){bStart = 1;setTimeout('fnToggle()', 2000);return;}else{oTransContainer.filters[0].Apply();document.images['oDIV'+next].style.display = "";document.images['oDIV'+NowFrame].style.display = "none";oTransContainer.filters[0].Play(duration=2);if(NowFrame == MaxFrame){NowFrame = 1;}else{NowFrame++;}} setTimeout('fnToggle()', 6000);}fnToggle();</script>
<a href="index.asp" target="_blank"><img class=pic id=oDIV2 src="image/02.jpg" width=655 height=137 style="DISPLAY: none;"></a>
<a href="index.asp" target="_blank"><img class=pic id=oDIV3 src="image/03.jpg" width=655 height=137 style="DISPLAY: none;"></a>
<a href="index.asp" target="_blank"><img class=pic id=oDIV4 src="image/04.jpg" width=655 height=137 style="DISPLAY: none;"></a>
<a href="index.asp" target="_blank"><img class=pic id=oDIV5 src="image/05.jpg" width=655 height=137 style="DISPLAY: none;"></a>
</div></td>
</tr>
</table>
</div>
<div style="clear:both;"><img src="images/lh/yy.jpg" vspace="1"></div>
</div>
<div style="float:right; width:245px;">
<table width="95%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="242" height="22" align="left" background="images/lh/lh_17.jpg" >
<ul class="tag">
<li id="pwnav1" class="active" OnMouseDown="javascript:showDiv('pw',1,2);" style="cursor: pointer;">用户登录</li>
</ul>
</td>
<td width="3" align="right"><img src="images/gaiban/spacer.gif" width="3" height="22" /></td>
</tr>
<tr>
<td height="3" colspan="2" valign="top"><img src="images/lh/lh_19.jpg" width="245" height="3" /></td>
</tr>
<tr>
<td height="110" colspan="2" valign="middle" bgcolor="#FFFFFF" style="border-left:1px solid #8DCAF2; border-right:1px solid #8DCAF2;">
<div id="pw1" style="display: block;">
<img src="images/lh/lh_22.jpg" />
<% dim v_user
v_user=session("user_name")
if session("user_name")<>"" then %>
<TABLE cellSpacing=0 cellPadding=0 width=90% align=center border=0>
<TBODY>
<TR>
<TD colSpan=2 valign="top" class=title1></TD>
</TR>
<TR>
<TD colspan="2" class=content_font1>欢迎您:<%=v_user%></TD>
</TR>
<TR>
<TD colSpan=2 height=28 class=content_font1><a href="fun.asp?type=9">退出</a></TD>
</TR>
<TR>
<TD colspan="2" class=content_font1> </TD>
</TR>
<TR>
<TD colSpan=2 valign="bottom"> <a href="F_key.asp?TB_iframe=true&height=250&width=575"> </a></TD>
</TR>
</TABLE>
<% else %>
<TABLE cellSpacing=0 cellPadding=0 width=90% align=center border=0>
<form name="user_load" id="user_load" method="post" action="Fun.asp?type=1" onsubmit="return false;" style="margin:0px; padding:0px;">
<TBODY>
<TR>
<TD colSpan=2 valign="top" class=title1> </TD>
</TR>
<TR>
<TD colspan="2" class=content_font1><INPUT size=23 name="user_name" id="user_name" class="sibian">
帐号</TD>
</TR>
<TR>
<TD colSpan=2 height=28 class=content_font1><input size=23 name="user_key" type="password" id="user_key" class="sibian" />
密码 </TD>
</TR>
<TR>
<TD colspan="2" class=content_font1> </TD>
</TR>
<TR>
<TD colSpan=2 valign="bottom"><input type="image" src="image/index/submit.gif" id="user_login" /> <a href="user_zc.asp"><img src="image/index/zhuce1.gif" /></a><a href="F_key.asp?TB_iframe=true&height=250&width=575"> <font color="#FF0000">忘记密码</font></a></TD>
</TR>
</FORM>
</TABLE>
<% end if
%>
</div>
</td>
</tr>
<tr>
<td height="6" colspan="2" align="left" background="images/gaiban/domain/huzh.gif" ><div style="height:9px; margin-bottom:9px;"><img src="images/lh_22.jpg" /></div></td>
</tr>
</table>
</div>
</div>
<!--页面主体部分-->
<div class="wai">
<div class="left">
<!--first-->
<div style="width:208px; float:left">
<div><img src="images/lh/lh_25.gif" width="208" height="122" border="0" /></div>
<div class="rexiao_1">
<%
set rs_news=server.createobject("adodb.recordset")
sqltext4="select top 4 * from ziliao order by id desc"
rs_news.open sqltext4,conn,1,1
%>
<ul class="leibiao" width="96%" align="left">
<%i=0
do while not rs_news.eof%>
<li style="background-image:url(images/winrar18.gif); padding-left:20px">
<a href="../<%=rs_news("url")%>"><%=cutstr(rs_news("title"),9)%></a>
<%if rs_news("time")=date() or rs_news("time")=date()-1 then%>
<img src="images/gaiban/i_r29_c108.jpg" width="19" height="9" hspace="5" />
<% end if %></td> </li>
<% rs_news.movenext
i=i+1
if i=4 then exit do
loop
rs_news.close %>
</ul>
<div align="right" style="margin:8px 10px 0px 0px; color:#FF6600"><a href="download.asp" ><img src="images/gaiban/spacer.gif" width="68" height="16" border="0" /></a></div>
</div>
</div>
<!--second-->
<div style="width:208px; float:left; margin:0px 15px;">
<div><img src="images/lh/lh_27.gif" width="208" height="122" border="0" /></div>
<div class="rexiao_2">
<%
set rs_news=server.createobject("adodb.recordset")
sqltext4="select top 4 * from kecheng order by id desc"
rs_news.open sqltext4,conn,1,1
%>
<style type="text/css">
img {border:0px;}
</style>
</head>
<%
function cutstr(tempstr,tempwid)
if len(tempstr)>tempwid then
cutstr=left(tempstr,tempwid)&"..."
else
cutstr=tempstr
end if
end function
%>
<%
function cutstr2(tempstr2,tempwid2)
if len(tempstr2)>tempwid2 then
cutstr2=left(tempstr2,tempwid2)
else
cutstr2=tempstr2
end if
end function
%>
<link href="css/css.css" rel="stylesheet" type="text/css">
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
<script language="javascript" src="../js/jquery.js"></script>
<script language="javascript" src="js/thickbox.js"></script>
<script language="javascript" src="../js/jquery.form.js"></script>
<script language="javascript" type="text/javascript">
$(function(){
$("#user_login").click(function(){
var user_name=$("#user_name").val();
var user_key=$("#user_key").val();
if (user_name==""){
alert("请输入用户名!")
$("#user_name").focus();
return false;
}
if (user_key==""){
alert("请输入密码!")
$("#user_key").focus();
return false;
}
else{
$("#user_load").ajaxForm(function(S){
if(S.search("成功")>0){
alert("登入成功!");
location.href="index.asp";
}else
{
alert(S);
$("#Key_Word").val("");
$("#SafeCode").val("");
return false;
}
})
}
})
})
</script>
<script language="JavaScript">
function Wmaplay(id){ //排行榜目标
window.open( 'playrm.asp?id='+id,'cnmusiclisten', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=452,height=490,top=200,left=200');
}
function lbsong() //联播目标
{
window.open("about:blank","lbsong","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,top=200,left=200,width=452,height=450");
}
</script>
</head>
<body>
y
<!--LOGO-->
<div class="bg_top">
<div style="float:left;"><img src="images/lh/top_img1.gif" width="444" height="98" /></div>
</div>
<!--导航-->
<div class="daohang">
<div style=" float:left; background:#2A87E6"><img src="images/gaiban/dh_03.jpg" width="9" height="32" /></div>
<a href="index.asp"><div style="float:left" class="dh_di2">首页</div></a>
<div style="float:left; height:32px;">
<ul class="dh_di">
<li><a href="kecheng.asp" class="bai2">网上课堂</a></li>
<li><a href="download.asp" class="bai2">资料下载</a></li>
<li><a href="shipin.asp" class="bai2">教学视频</a></li>
<li><a href="text.asp" class="bai2">在线测试</a></li>
<li><a href="liuyan.asp" class="bai2">留言版</a></li>
<li><a href="user_zc.asp" class="bai2">注册</a></li>
<li><a href="../admin/login.html" class="bai2">管理员登录</a></li>
</ul>
</div>
<div style="float:right; background:#2A87E6"><img src="images/lh/dh_07.jpg" width="10" height="32" /></div>
</div>
<!--banner-->
<div class="banner">
<div class="flash">
<div style="margin:0px; border:0px; float:inherit; margin-left:0; padding-left:0">
<table width="655" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td> <div id=oTransContainer
style="FILTER: progid:DXImageTransform.Microsoft.Wipe(GradientSize=1.0,wipeStyle=0, motion='forward'); WIDTH: 655px; HEIGHT: 137px"><a href="index.asp" target="_blank"><a href="index.asp" target="_blank"><a href="index.asp" target="_blank"></a><a href="index.asp" target="_blank"><img class=pic id=oDIV1 src="image/01.jpg" width=655 height=137 /></a>
<script>var NowFrame = 1;var MaxFrame = 5;var bStart = 0;function fnToggle(){var next = NowFrame + 1;if(next == MaxFrame+1) {NowFrame = MaxFrame;next = 1;}if(bStart == 0){bStart = 1;setTimeout('fnToggle()', 2000);return;}else{oTransContainer.filters[0].Apply();document.images['oDIV'+next].style.display = "";document.images['oDIV'+NowFrame].style.display = "none";oTransContainer.filters[0].Play(duration=2);if(NowFrame == MaxFrame){NowFrame = 1;}else{NowFrame++;}} setTimeout('fnToggle()', 6000);}fnToggle();</script>
<a href="index.asp" target="_blank"><img class=pic id=oDIV2 src="image/02.jpg" width=655 height=137 style="DISPLAY: none;"></a>
<a href="index.asp" target="_blank"><img class=pic id=oDIV3 src="image/03.jpg" width=655 height=137 style="DISPLAY: none;"></a>
<a href="index.asp" target="_blank"><img class=pic id=oDIV4 src="image/04.jpg" width=655 height=137 style="DISPLAY: none;"></a>
<a href="index.asp" target="_blank"><img class=pic id=oDIV5 src="image/05.jpg" width=655 height=137 style="DISPLAY: none;"></a>
</div></td>
</tr>
</table>
</div>
<div style="clear:both;"><img src="images/lh/yy.jpg" vspace="1"></div>
</div>
<div style="float:right; width:245px;">
<table width="95%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="242" height="22" align="left" background="images/lh/lh_17.jpg" >
<ul class="tag">
<li id="pwnav1" class="active" OnMouseDown="javascript:showDiv('pw',1,2);" style="cursor: pointer;">用户登录</li>
</ul>
</td>
<td width="3" align="right"><img src="images/gaiban/spacer.gif" width="3" height="22" /></td>
</tr>
<tr>
<td height="3" colspan="2" valign="top"><img src="images/lh/lh_19.jpg" width="245" height="3" /></td>
</tr>
<tr>
<td height="110" colspan="2" valign="middle" bgcolor="#FFFFFF" style="border-left:1px solid #8DCAF2; border-right:1px solid #8DCAF2;">
<div id="pw1" style="display: block;">
<img src="images/lh/lh_22.jpg" />
<% dim v_user
v_user=session("user_name")
if session("user_name")<>"" then %>
<TABLE cellSpacing=0 cellPadding=0 width=90% align=center border=0>
<TBODY>
<TR>
<TD colSpan=2 valign="top" class=title1></TD>
</TR>
<TR>
<TD colspan="2" class=content_font1>欢迎您:<%=v_user%></TD>
</TR>
<TR>
<TD colSpan=2 height=28 class=content_font1><a href="fun.asp?type=9">退出</a></TD>
</TR>
<TR>
<TD colspan="2" class=content_font1> </TD>
</TR>
<TR>
<TD colSpan=2 valign="bottom"> <a href="F_key.asp?TB_iframe=true&height=250&width=575"> </a></TD>
</TR>
</TABLE>
<% else %>
<TABLE cellSpacing=0 cellPadding=0 width=90% align=center border=0>
<form name="user_load" id="user_load" method="post" action="Fun.asp?type=1" onsubmit="return false;" style="margin:0px; padding:0px;">
<TBODY>
<TR>
<TD colSpan=2 valign="top" class=title1> </TD>
</TR>
<TR>
<TD colspan="2" class=content_font1><INPUT size=23 name="user_name" id="user_name" class="sibian">
帐号</TD>
</TR>
<TR>
<TD colSpan=2 height=28 class=content_font1><input size=23 name="user_key" type="password" id="user_key" class="sibian" />
密码 </TD>
</TR>
<TR>
<TD colspan="2" class=content_font1> </TD>
</TR>
<TR>
<TD colSpan=2 valign="bottom"><input type="image" src="image/index/submit.gif" id="user_login" /> <a href="user_zc.asp"><img src="image/index/zhuce1.gif" /></a><a href="F_key.asp?TB_iframe=true&height=250&width=575"> <font color="#FF0000">忘记密码</font></a></TD>
</TR>
</FORM>
</TABLE>
<% end if
%>
</div>
</td>
</tr>
<tr>
<td height="6" colspan="2" align="left" background="images/gaiban/domain/huzh.gif" ><div style="height:9px; margin-bottom:9px;"><img src="images/lh_22.jpg" /></div></td>
</tr>
</table>
</div>
</div>
<!--页面主体部分-->
<div class="wai">
<div class="left">
<!--first-->
<div style="width:208px; float:left">
<div><img src="images/lh/lh_25.gif" width="208" height="122" border="0" /></div>
<div class="rexiao_1">
<%
set rs_news=server.createobject("adodb.recordset")
sqltext4="select top 4 * from ziliao order by id desc"
rs_news.open sqltext4,conn,1,1
%>
<ul class="leibiao" width="96%" align="left">
<%i=0
do while not rs_news.eof%>
<li style="background-image:url(images/winrar18.gif); padding-left:20px">
<a href="../<%=rs_news("url")%>"><%=cutstr(rs_news("title"),9)%></a>
<%if rs_news("time")=date() or rs_news("time")=date()-1 then%>
<img src="images/gaiban/i_r29_c108.jpg" width="19" height="9" hspace="5" />
<% end if %></td> </li>
<% rs_news.movenext
i=i+1
if i=4 then exit do
loop
rs_news.close %>
</ul>
<div align="right" style="margin:8px 10px 0px 0px; color:#FF6600"><a href="download.asp" ><img src="images/gaiban/spacer.gif" width="68" height="16" border="0" /></a></div>
</div>
</div>
<!--second-->
<div style="width:208px; float:left; margin:0px 15px;">
<div><img src="images/lh/lh_27.gif" width="208" height="122" border="0" /></div>
<div class="rexiao_2">
<%
set rs_news=server.createobject("adodb.recordset")
sqltext4="select top 4 * from kecheng order by id desc"
rs_news.open sqltext4,conn,1,1
%>