<marquee scrolldelay="200" bgcolor="white" onmouseover="this.stop()" onmouseout="this.start()" behavior='alternate'>
<table>
<tr><td>($aaaaa$)</td>
    <td>($bbbbb$)</td>
    <td>($ccccc$)</td>
    <td>($ddddd$)</td>
</tr>
</table>
</marquee>剩下的你自己在table里面加入数库中的字段+条件判断(显示10条)

解决方案 »

  1.   

    数据库里取出n条记录:
    sql="select top n * from test"显示时候,为了限制10条,就加一个变量:
    i=0;
    while(rs.next() and i<10)
    {
      输出语句;
      i++;
     }
      

  2.   

    可以用一个土办法, 在记录之间插入一定数量的换行符,既快又省事,至于怎么分记录,这个不用教了吧,向上滚动,只需要加一个属性就可以了  direction = 'up'
      

  3.   

    <%String sql="select Top 10 * from ......"
    ResultSet rs=stat.ExecuteQuery(sql);
    %>
    <marquee id='mymarquee' behavior=scroll direction=up width=150 height=220 scrollamount=1 scrolldelay=10 onmouseover='mymarquee.stop()' onmouseout='mymarquee.start()'>
    <%while (rs.next()){
    out.print(rs.getString("content"));}
    %>
    </marquee>
      

  4.   

    滚10条停一下,然后再滚10条,代码如下:<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 ALIGN="center" WIDTH="100%"> <TBODY> 
    <TR > <TD CLASS=p9 COLSPAN=2> <SCRIPT LANGUAGE=JavaScript>
    var scrollerwidth=140
    var scrollerheight=120
    var scrollerbgcolor=''
    var messages=new Array()
    //////////////////////////读出记录
    <%String sql="select * from test";
    ResultSet rs=bean.executesql(sql);
    int k=0,i=0;
    while (rs.next())
    {
    %>
    messages[<%=i%>]=rs("jilu");
    <%
    k+=1;
    if ((k%10)==0) i+=1;}
    %>
    /////////////////////////////记录读出结束!
    if (messages.length>1)
    i0=2
    else
    i0=0
    function movea(){
    document.main.document.first.visibility='show'
    document.main.document.second.visibility='hide'
    document.main.document.third.visibility='hide'
    setTimeout("moveb()",8000);
    }
    function moveb(){
    document.main.document.first.visibility='hide'
    document.main.document.second.visibility='show'
    document.main.document.third.visibility='hide'
    setTimeout("movec()",8000);
    }
    function movec(){
    document.main.document.first.visibility='hide'
    document.main.document.second.visibility='hide'
    document.main.document.third.visibility='show'
    setTimeout("movea()",8000);
    }
    function show(whichlayer){
    tlayer=eval(whichlayer)
    tlayer.visibility='show'
    }
    function hide(whichlayer){
    tlayer=eval(whichlayer)
    tlayer.visibility='hide'
    }
    function move3(whichdiv){
    tdiv=eval(whichdiv)
    if (tdiv.style.pixelTop>0&&tdiv.style.pixelTop<=5){
    tdiv.style.pixelTop=0
    setTimeout("move3(tdiv)",5000)
    setTimeout("move4(second2)",5000)
    return
    }
    if (tdiv.style.pixelTop>=tdiv.offsetHeight*-1){
    tdiv.style.pixelTop-=5
    setTimeout("move3(tdiv)",100)
    }
    else{
    tdiv.style.pixelTop=scrollerheight
    tdiv.innerHTML=messages[i0]
    if (i0==messages.length-1)
    i0=0
    else
    i0++
    }
    }
    function move4(whichdiv){
    tdiv2=eval(whichdiv)
    if (tdiv2.style.pixelTop>0&&tdiv2.style.pixelTop<=5){
    tdiv2.style.pixelTop=0
    setTimeout("move4(tdiv2)",5000)
    setTimeout("move3(first2)",5000)
    return
    }
    if (tdiv2.style.pixelTop>=tdiv2.offsetHeight*-1){
    tdiv2.style.pixelTop-=5
    setTimeout("move4(second2)",100)
    }
    else{
    tdiv2.style.pixelTop=scrollerheight
    tdiv2.innerHTML=messages[i0]
    if (i0==messages.length-1)
    i0=0
    else
    i0++
    }
    }
    function startscroll(){
    if (document.all){
    move3(first2)
    second2.style.top=scrollerheight
    second2.style.visibility='visible'
    }
    else if (document.layers){
    movea();}
    }
    window.onload=startscroll
    </SCRIPT> <ILAYER ID=main HEIGHT="50" 
                      WIDTH="136" LEFT="-15" TOP="-31"></ILAYER><SCRIPT LANGUAGE=JavaScript1.2>
    if (document.all){
    document.writeln('<span id="main2" style="position:relative;width:'+scrollerwidth+';height:'+scrollerheight+';overflow:hiden;background-color:'+scrollerbgcolor+'">')
    document.writeln('<div style="position:absolute;width:'+scrollerwidth+';height:'+scrollerheight+';clip:rect(0 '+scrollerwidth+' '+scrollerheight+' 0);left:0;top:0">')
    document.writeln('<div id="first2" style="position:absolute;width:'+scrollerwidth+';left:0;top:1;">')
    document.write(messages[0])
    document.writeln('</div>')
    document.writeln('<div id="second2" style="position:absolute; visibility: hidden; width:'+scrollerwidth+';left:0;top:0">')
    document.write(messages[1])
    document.writeln('</div>')
    document.writeln('</div>')
    document.writeln('</span>')
    }
    </SCRIPT> </TD></TR> </TBODY> </TABLE> 
      

  5.   

    messages[<%=i%>]=rs("jilu");改成
    messages[<%=i%>]="<%=rs.getString("jilu")%>";