楼主是在什么环境下进行的测试?
我在IE7和FF3下像你这样改了之后程序照样跑得很好。
甚至我改成了800也没有发现问题。

解决方案 »

  1.   

    不会啊,我用的也是ie7,宽度改大了就不行了,而且我在我同学那里测试也不行,他用的是ie6
      

  2.   

    把table宽度改大点 
    <table border="1" width="401"> 想知道为什么停 
    function Marquee(){ 
    window.status=demo2.offsetWidth+ "| "+demo.scrollLeft;//加上这句 
    运行时看下状态栏就知道了。
      

  3.   

    还不明白的话
    把div的overflow:hidden;
    改成overflow:scroll
    运行看效果,然后自己解决。
      

  4.   

    楼主使用了DTD?
    看看下面代码在你那里是不是有问题?<html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        </head>
        <body>
            <div id=demo style=overflow:hidden;height:139;width:800;background:#f4f4f4;color:#ffffff>
                <table align=left cellpadding=0 cellspace=0 border=0>
                    <tr>
                        <td id=demo1 valign=top>
                            <img onload="if(this.width>600) {this.resized=true; this.width=600;}" onmouseover="this.style.cursor='hand'" onclick="{window.open('http://www.makewing.com/lanren/jscode/js-0063/images/01.jpg');}" src="http://www.makewing.com/lanren/jscode/js-0063/images/01.jpg"><img src="http://www.makewing.com/lanren/jscode/js-0063/images/02.jpg"><img onload="if(this.width>600) {this.resized=true; this.width=600;}" onmouseover="this.style.cursor='hand'" onclick="{window.open('http://www.makewing.com/lanren/jscode/js-0063/images/03.jpg');}" src="http://www.makewing.com/lanren/jscode/js-0063/images/03.jpg"><img src="http://www.makewing.com/lanren/jscode/js-0063/images/04.jpg"><img onload="if(this.width>600) {this.resized=true; this.width=600;}" onmouseover="this.style.cursor='hand'" onclick="{window.open('http://www.makewing.com/lanren/jscode/js-0063/images/05.jpg');}" src="http://www.makewing.com/lanren/jscode/js-0063/images/05.jpg">
                        </td>
                        <td id=demo2 valign=top>
                        </td>
                    </tr>
                </table>
            </div>
            <script>
                var speed = 30
                demo2.innerHTML = demo1.innerHTML
                function Marquee(){
                    if (demo2.offsetWidth - demo.scrollLeft <= 0) 
                        demo.scrollLeft -= demo1.offsetWidth
                    else {
                        demo.scrollLeft++
                    }
                }
                
                var MyMar = setInterval(Marquee, speed)
                demo.onmouseover = function(){
                    clearInterval(MyMar)
                }
                demo.onmouseout = function(){
                    MyMar = setInterval(Marquee, speed)
                }
            </script>
        </body>
    </html>
      

  5.   

    <div id=demo style=overflow:hidden;height:139;width:232;background:#f4f4f4;color:#ffffff>
    <table align=left cellpadding=0 cellspace=0 border=0>
    <tr>
    <td id=demo1 valign=top>
    <img onload="if(this.width>600) {this.resized=true; this.width=600;}" onmouseover="this.style.cursor='hand'" onclick="{window.open('http://www.makewing.com/lanren/jscode/js-0063/images/01.jpg');}" src="http://www.makewing.com/lanren/jscode/js-0063/images/01.jpg" >
    <img src="http://www.makewing.com/lanren/jscode/js-0063/images/02.jpg">
    <img onload="if(this.width>600) {this.resized=true; this.width=600;}" onmouseover="this.style.cursor='hand'" onclick="{window.open('http://www.makewing.com/lanren/jscode/js-0063/images/03.jpg');}" src="http://www.makewing.com/lanren/jscode/js-0063/images/03.jpg" >
    <img src="http://www.makewing.com/lanren/jscode/js-0063/images/04.jpg">
    <img onload="if(this.width>600) {this.resized=true; this.width=600;}" onmouseover="this.style.cursor='hand'" onclick="{window.open('http://www.makewing.com/lanren/jscode/js-0063/images/05.jpg');}" src="http://www.makewing.com/lanren/jscode/js-0063/images/05.jpg" >
    </td>
    <td id=demo2 valign=top>
    </td>
    </tr>
    </table>
    </div>
    <div id=aaa>sdfsdfsdfsdf</div><script>
    var o=document.getElementById("aaa")
    var speed=30
    demo2.innerHTML=demo1.innerHTML
    function Marquee(){
      document.getElementById("aaa").innerHTML='demo.scrollLeft:  '+demo.scrollLeft+'<br>demo1.offsetWidth:  '+demo1.offsetWidth;
      if(demo2.offsetWidth-demo.scrollLeft <=0){
        demo.scrollLeft-=demo1.offsetWidth;
      }
      else{demo.scrollLeft++}
    }var MyMar=setInterval(Marquee,speed)
    demo.onmouseover=function() {clearInterval(MyMar)}
    demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
    </script> 
    加上红字,自己看看什么问题
      

  6.   

    呵呵,你们都忽略重要的一点
    就是你显示宽度和width:232;这个宽度最少要和他相等
    http://blog.csdn.net/chinmo/archive/2008/09/12/2915629.aspx你仔细看我这个里面这个的几个宽度关系你就明白了