<marquee id=test width=100>test test</marquee><input type=button value=start onclick="test.start()">  
<script>test.stop()</script>

解决方案 »

  1.   

    <marquee id=marquee1 width=200 onmouseout="this.stop();">laskdjfkjsdf</marquee>
    <input type=button vlaue="start" onclick="marquee1.start();">
      

  2.   

    用stop方法的话初始化的时候marquee里面什么都没有,希望得到的效果是初始化的时候文字在marquee的开头,但不滚动。
      

  3.   

    模拟一个,效果不错,没间断
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>连续向左滚动</title>
    <style type="text/css">
    <!--
    body {
    font-size: 9pt;
    color: #000000;
    }
    a {
        color: #0000FF;
    text-decoration: none;
    }
    a:hover {
    color: #FF0000;
    text-decoration: underline;
    }
    -->
    </style>
    </head><body><div id="marquees">
    <a href="1.htm"><img src="csdn.gif"></a>
    <a href="2.htm"><img src="csdn2.gif"></a>
    <a href="3.htm"><img src="csdn.gif"></a>
    <a href="4.htm"><img src="csdn2.gif"></a>
    </div>
    <div id="templayer" style="position:absolute;left:0;top:0;visibility:hidden"></div>
    <input type=button value=test onclick="init()">
    <script language="JavaScript">marqueesWidth=200;with(marquees){
    style.height=0;
    style.width=marqueesWidth;
    style.overflowX="hidden";
    style.overflowY="visible";
    noWrap=true;
    onmouseover=new Function("stopscroll=true");
    onmouseout=new Function("stopscroll=false");
    }
    preLeft=0; currentLeft=0; stopscroll=false;function init(){
    templayer.innerHTML="";
    while(templayer.offsetWidth<marqueesWidth){
    templayer.innerHTML+=marquees.innerHTML;
    }
    marquees.innerHTML+=templayer.innerHTML;
    setInterval("scrollLeft()",10);
    }function scrollLeft(){
    if(stopscroll==true) return;
    preLeft=marquees.scrollLeft;
    marquees.scrollLeft+=1;
    if(preLeft==marquees.scrollLeft){
      marquees.scrollLeft=templayer.offsetWidth-marqueesWidth+1;
    }
    }
    </script>
    </body>
    </html>