<!--<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "  http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">-->
<html xmlns="  http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<table width= "499 " border= "1" cellpadding= "0" cellspacing= "0" bordercolor= "#CC6600">
<tr>
<td width= "495"><div id=demo style=overflow:hidden;height:70;width:400>
<div id=demo1> <a href= '' target= '_blank '> 这是滚动第1行 </a> <br>
这是滚动第2行 <br>
这是滚动第3行 <br>
这是滚动第4行 <br>
这是滚动第5行 <br>
这是滚动第6行 <br>
这是滚动第7行 <br>
这是滚动第8行 <br>
</div>
<div id=demo2> </div>
</div><script>
var speed=20
var demo2 = document.getElementById("demo2");
var demo1 = document.getElementById("demo1");
demo2.innerHTML=demo1.innerHTML
function Marquee()
{
if(demo2.offsetTop-demo.scrollTop <=0)
demo.scrollTop-=demo1.offsetHeight
else
{
demo.scrollTop++
}
}
var MyMar=setInterval(Marquee,speed)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</script>
</td>
</tr>
</table>
</body>
</html>

解决方案 »

  1.   

    单位加上
    <div id=demo style=overflow:hidden;height:70;width:400>==><div id=demo style=overflow:hidden;height:70px;width:400px>
      

  2.   

    而且你的demo变量最好申明下,而不是直接使用dom树的id,要不ff下出错var demo=document.getElementById('demo');//=========
        demo.onmouseover=function() {clearInterval(MyMar)}
        demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
      

  3.   


    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE> New Document </TITLE>
    </HEAD><BODY>
    <STYLE type="text/css">
    A { 
    font-size:13px;
    color:#000000;
    /*无下划线的链接文字样式*/
    text-decoration:none;
    line-height:22px;
    }
    A:hover {
    font-size:13px;
    color:#FF0000;
    /*有下划线的链接文字样式*/
    text-decoration:underline;
    line-height:22px;
    }
    </STYLE></HEAD>
    <BODY leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
    <div>
    <TABLE width="252" border="0" cellspacing="0" cellpadding="0" align="center">
    <TR>
    <TD background="image/bg.gif" >
    <DIV id="dome" style="overflow:hidden;height:150px; width=245px;">
    <DIV id="dome1" >
    <a href= '' target= '_blank '> 这是滚动第1行 </a> <br>
                        这是滚动第2行 <br>
                        这是滚动第3行 <br>
                        这是滚动第4行 <br>
                        这是滚动第5行 <br>
                        这是滚动第6行 <br>
                        这是滚动第7行 <br>
                        这是滚动第8行 <br>
    </DIV>
    <DIV id=dome2></DIV>
    </DIV>
    </TD>
    </TR>

    </TABLE>
    </div>
    <SCRIPT language="JavaScript">
    var speed=50; //设置文字滚动速度
    dome2.innerHTML=dome1.innerHTML //复制dome1为dome2
    function Marquee(){
    if(dome2.offsetTop-dome.scrollTop<=0) //当滚动至dome1与dome2交界时
    dome.scrollTop-=dome1.offsetHeight //dome跳到最顶端
    else{
    dome.scrollTop++
    }
    }
    var MyMar=setInterval(Marquee,speed) //设置定时器
    dome.onmouseover=function() {clearInterval(MyMar)}//鼠标移上时清除定时器达到滚动停止的目的
    dome.onmouseout=function() {MyMar=setInterval(Marquee,speed)}//鼠标移开时重设定时器,继续滚动
    </SCRIPT>
    </BODY>
    </HTML>
      

  4.   


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "  http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="  http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    </head>
    <body>
    <table width= "499 " border= "1" cellpadding= "0" cellspacing= "0" bordercolor= "#CC6600">
        <tr>
            <td width= "495"><div id=demo style=overflow:hidden;height:70px;width:400px>
                    <div id=demo1> <a href= '' target= '_blank '> 这是滚动第1行 </a> <br>
                        这是滚动第2行 <br>
                        这是滚动第3行 <br>
                        这是滚动第4行 <br>
                        这是滚动第5行 <br>
                        这是滚动第6行 <br>
                        这是滚动第7行 <br>
                        这是滚动第8行 <br>
                    </div>
                    <div id=demo2> </div>
                </div>
    <script>
        var speed=20
        var demo2 = document.getElementById("demo2");
        var demo1 = document.getElementById("demo1");
        demo2.innerHTML=demo1.innerHTML
        function Marquee()
        {
            if(demo2.offsetTop-demo.scrollTop <=0)
            demo.scrollTop-=demo1.offsetHeight
        else
            {
            demo.scrollTop++
            }
        }
        var MyMar=setInterval(Marquee,speed)
        demo.onmouseover=function() {clearInterval(MyMar)}
        demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
    </script>
      </td>
        </tr>
    </table>
    </body>
    </html>