网页打字机效果,用于新闻标题.数据库动态.
系统
1521 0
数据库结构仍然同我之前发的为同一个
<!--打字机效果出现文字,带相应连接,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>
网页打字机效果,用于新闻标题.数据库动态.
更多文章、技术交流、商务合作、联系博主
微信扫码或搜索:z360901061
微信扫一扫加我为好友
QQ号联系: 360901061
您的支持是博主写作最大的动力,如果您喜欢我的文章,感觉我的文章对您有帮助,请用微信扫描下面二维码支持博主2元、5元、10元、20元等您想捐的金额吧,狠狠点击下面给点支持吧,站长非常感激您!手机微信长按不能支付解决办法:请将微信支付二维码保存到相册,切换到微信,然后点击微信右上角扫一扫功能,选择支付二维码完成支付。
【本文对您有帮助就好】元