网页打字机效果,用于新闻标题.数据库动态.

<script type="text/javascript"> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>

数据库结构仍然同我之前发的为同一个

<!--打字机效果出现文字,带相应连接,FIREFOX不支持-->
<!--#include file="inc/conn.asp"-->
<style type="text/css">
<!--
#hotNews{ margin:0  auto; width:471px; height:24px; background:#f6f6f6; border-top:1px solid #000; border-bottom:1px solid #000;}
#hotNews h2{float:left; padding:6px 0 0 6px; font-size:12px; font-weight:normal;color:#bc2931;}
#hotNews a{color:#bc2931;}
#hotNews a:hover{color:#000;}
#hotNews_new{ margin:0  auto; width:471px; overflow:hidden; height:24px; background:#f6f6f6; border-top:1px solid #000; border-bottom:1px solid #000;}
#hotNews_new h5{float:left; padding:6px 0 0 6px; font-size:12px; font-weight:normal;color:#bc2931;}
#hotNews_new h6{float:left; text-align:left; padding:6px 0 0 4px; overflow:hidden; width:330px; font-size:12px; font-weight:normal;color:#bc2931;}
#hotNews_new span{float:right; padding:6px 8px 0 0; width:75px;}
#hotNews_new a{color:#bc2931;}
#hotNews_new a:hover{color:#000;}

-->
</style>
<DIV id=hotNews_new><H6>·<A id=printWord href=""></A></H6>
<%Set rs=Server.CreateObject("ADODB.Recordset")
sql="select top 6 * from product order by updatetime desc"
rs.open sql,conn,1,1%>
<SCRIPT language=JavaScript>
var NewsTime = 3500;
var TextTime = 20;
var newsi = 0;
var txti = 0;
var txttimer;
var newstimer;
var newstitle = new Array();
var newshref = new Array();
<%i=-1'因为要从0计数
do while not rs.eof
i=i+1
%>
newstitle[<%=i%>] = "<%=rs("title")%>";
newshref[<%=i%>] = "productshow.asp?articleid=<%=rs("articleid")%>";
<%rs.movenext
loop%>

function shownews()
{
var endstr = "_"
hwnewstr = newstitle[newsi];
newslink = newshref[newsi];
if(txti==(hwnewstr.length-1)){endstr="";}
if(txti>=hwnewstr.length){
clearInterval(txttimer);
clearInterval(newstimer);
newsi++;
if(newsi>=newstitle.length){
newsi = 0
}
newstimer = setInterval("shownews()",NewsTime);
txti = 0;
return;
}
clearInterval(txttimer);
document.getElementById("printWord").href=newslink;
document.getElementById("printWord").innerHTML = hwnewstr.substring(0,txti+1)+endstr;
txti++;
txttimer = setInterval("shownews()",TextTime);
}
shownews();
</SCRIPT>
</div> 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值