http://www.lslnet.com/linux/dosc1/09/linux-149763.htm

解决方案 »

  1.   


    <script>
    var marqueeContent=new Array();   //定义一个数组,用来存放显示内容
    marqueeContent[0]='<A href="#" onclick="reinitMarquee()">刷新最新列表</FONT></A>';
    marqueeContent[1]='<a href=http://www.blueidea.com/updatelist.asp target=_blank>站点最新更新六十条</a>';
    marqueeContent[2]='<A href=http://www.blueidea.com/tech/graph/2003/875.asp target=_blank>羽毛效果制作教程</a>';
    marqueeContent[3]='<A href=http://www.blueidea.com/tech/program/2003/831.asp target=_blank>MySQL&ASP</a>';
    marqueeContent[4]='<A href=http://www.blueidea.com/tech/web/2003/874.asp target=_blank>初步了解CSS3</a>';
    marqueeContent[5]='<A href=http://www.blueidea.com/tech/graph/2003/864.asp target=_blank>Fireworks MX 2004执行面版操作</a>';
    marqueeContent[6]='<A href=http://www.blueidea.com/tech/graph/2003/872.asp target=_blank>Fireworks MX 2004等高渐变填充</a>';
    marqueeContent[7]='<A href=http://www.blueidea.com/photo/gallery/2003/873.asp target=_blank>瓶子里的花</a>';
    marqueeContent[8]='<A href=http://www.blueidea.com/tech/graph/2003/871.asp target=_blank>Fireworks MX 实现选项卡式效果</a>';
    marqueeContent[9]='<A href=http://www.blueidea.com/photo/gallery/2003/870.asp target=_blank>情侣:黑白的爱情空气</a>';
    marqueeContent[10]='<A href=http://www.blueidea.com/tech/graph/2003/866.asp target=_blank>制作 MAC 风格的苹果标志</a>';
    marqueeContent[11]='<A href=http://www.blueidea.com/tech/graph/2003/868.asp target=_blank>蛋壳制作及破壳而出的人物合成</a>';var marqueeInterval=new Array();  //定义一些常用而且要经常用到的变量
    var marqueeId=0;
    var marqueeDelay=4000;
    var marqueeHeight=36;//接下来的是定义一些要使用到的函数
    Array.prototype.random=function() {
            var a=this;
            var l=a.length;
            for(var i=0;i<l;i++) {
                    var r=Math.floor(Math.random()*(l-i));
                    a=a.slice(0,r).concat(a.slice(r+1)).concat(a[r]);
                    }
            return a;
            }
    function initMarquee() {
            marqueeContent=marqueeContent.random();
            var str='';
            for(var i=0;i<Math.min(3,marqueeContent.length);i++) str+=(i>0?'  ':'')+marqueeContent[i];
            document.write('<div id=marqueeBox style="overflow:hidden;height:'+marqueeHeight+'px" onmouseover="clearInterval(marqueeInterval[0])" onmouseout="marqueeInterval[0]=setInterval(\'startMarquee()\',marqueeDelay)"><div>'+str+'</div></div>');
            marqueeId+=2;
            if(marqueeContent.length>3)marqueeInterval[0]=setInterval("startMarquee()",marqueeDelay);
            }
    function reinitMarquee() {
            js_scroll_content.src='scroll_content2.js';
            marqueeContent=marqueeContent.random();
            var str='';
            for(var i=0;i<Math.min(3,marqueeContent.length);i++) str+=(i>0?'  ':'')+marqueeContent[i];
            marqueeBox.childNodes[(marqueeBox.childNodes.length==1?0:1)].innerHTML=str;
            marqueeId=2;
            }
    function startMarquee() {
            var str='';
            for(var i=0;(i<3)&&(marqueeId+i<marqueeContent.length);i++) {
                    str+=(i>0?'  ':'')+marqueeContent[marqueeId+i];
                    }
            marqueeId+=3;
            if(marqueeId>marqueeContent.length)marqueeId=0;        if(marqueeBox.childNodes.length==1) {
                    var nextLine=document.createElement('DIV');
                    nextLine.innerHTML=str;
                    marqueeBox.appendChild(nextLine);
                    }
            else {
                    marqueeBox.childNodes[0].innerHTML=str;
                    marqueeBox.appendChild(marqueeBox.childNodes[0]);
                    marqueeBox.scrollTop=0;
                    }
            clearInterval(marqueeInterval[1]);
            marqueeInterval[1]=setInterval("scrollMarquee()",20);
            }
    function scrollMarquee() {
            marqueeBox.scrollTop++;
            if(marqueeBox.scrollTop%marqueeHeight==(marqueeHeight-1)){
                    clearInterval(marqueeInterval[1]);
                    }
            }
    initMarquee();
    </script>上面的代码是第次只显示一条,我想同时显示几条然后再停,请问怎么个改法,谢谢啦
      

  2.   

    <div style="height:20;overflow-y:hidden;">
    <table id="table">
    <tr>
    <td><a href=http://www.blueidea.com/updatelist.asp target=_blank>站点最新更新六十条</a>
    <A href=http://www.blueidea.com/tech/graph/2003/875.asp target=_blank>羽毛效果制作教程</a>
    <A href=http://www.blueidea.com/tech/program/2003/831.asp target=_blank>MySQL&ASP</a>
    <A href=http://www.blueidea.com/tech/web/2003/874.asp target=_blank>初步了解CSS3</a>
    </td>
    </tr>
    <tr>
    <td><A href=http://www.blueidea.com/tech/graph/2003/864.asp target=_blank>Fireworks MX 2004执行面版操作</a>
    <A href=http://www.blueidea.com/tech/graph/2003/872.asp target=_blank>Fireworks MX 2004等高渐变填充</a>
    <A href=http://www.blueidea.com/photo/gallery/2003/873.asp target=_blank>瓶子里的花</a>
    <A href=http://www.blueidea.com/tech/graph/2003/871.asp target=_blank>Fireworks MX 实现选项卡式效果</a>
    </td>
    </tr>
    <tr>
    <td><A href=http://www.blueidea.com/photo/gallery/2003/870.asp target=_blank>情侣:黑白的爱情空气</a>
    <A href=http://www.blueidea.com/tech/graph/2003/866.asp target=_blank>制作 MAC 风格的苹果标志</a>
    <A href=http://www.blueidea.com/tech/graph/2003/868.asp target=_blank>蛋壳制作及破壳而出的人物合成</a>
    </td>
    </tr><script language=javascript>
    var tempArray=new Array(['站点最新更新六十条 羽毛效果制作教程 MySQL&ASP 初步了解CSS3',3000],['Fireworks MX 2004执行面版操作 Fireworks MX 2004等高渐变填充 瓶子里的花 Fireworks MX 实现选项卡式效果',4000],['情侣:黑白的爱情空气 制作 MAC 风格的苹果标志 蛋壳制作及破壳而出的人物合成',2000])
    i=0;
    objTbody=document.getElementById("table").childNodes[0]
    function show()
    {
    if(i==2)i=0;
    objTbody.appendChild(objTbody.childNodes[0])
    i++;
    setTimeout("show()",tempArray[i][1])
    }
    setTimeout("show()",tempArray[i][1])
    </script>