網頁打字機效果,用于新聞標題.數據庫動態.
系統
1759 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元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對您有幫助就好】元