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


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

    <!--打字机效果出现文字,带相应连接,FIREFOX不支持-->
    <!--#include file="inc/conn.asp"-->
    <style type="text/css">
    <!--
    #hotNews{ margin:0  auto; 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; 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; 330px; font-size:12px; font-weight:normal;color:#bc2931;}
    #hotNews_new span{float:right; padding:6px 8px 0 0; 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> 

  • 相关阅读:
    Leetcode 238. Product of Array Except Self
    来博客园的第一天
    [LeetCode] 1020. Number of Enclaves
    [LeetCode] 921. Minimum Add to Make Parentheses Valid
    [LeetCode] 1541. Minimum Insertions to Balance a Parentheses String
    [LeetCode] 738. Monotone Increasing Digits
    [LeetCode] 1669. Merge In Between Linked Lists
    [LeetCode] 865. Smallest Subtree with all the Deepest Nodes
    [LeetCode] 376. Wiggle Subsequence
    [LeetCode] 1170. Compare Strings by Frequency of the Smallest Character
  • 原文地址:https://www.cnblogs.com/zerogo/p/2209383.html
Copyright © 2020-2023  润新知