怎样的跑马灯?如果是marquee,直接使用
<marquee onmouseover="this.stop()" onmouseout="this.start()">123</marquee>

解决方案 »

  1.   

    <script language="Javascript">
    <!--
    var tid=null
    var x = 0
    var speed = 120
    var text = "AAAAAAAAAAAAAAAAAAAAAAAAAAAA"
    var course = 120
    var text2 = textfunction Scroll() {
    window.status = text2.substring(0, text2.length)if (course < text2.length) {
    tid=setTimeout("Scroll2()", speed)
    }else {
    text2 = " " + text2tid=setTimeout("Scroll()", speed);
    }
    }function Scroll2() {
    window.status = text2.substring(x, text2.length)if (text2.length - x == text.length) { 
    text2 = text
    x = 0tid=setTimeout("Scroll()", speed);
    }else {
    x++
    tid=setTimeout("Scroll2()", speed);
    }
    }Scroll()
    //-->
    </script>
    <input onclick="clearTimeout(tid)" type=button value="stop">
    <input onclick='tid=setTimeout("Scroll()", speed)' type=button value="start">
      

  2.   

    <marquee direction="up" onmouseover="this.stop()" onmouseout="this.start()">跑马灯</marquee>