我把你给我参考的那段代码全部存成一个新的HTM文件,然后在FIREFOX中打开,根本就不滚动。
所以我也就没仔细再往下看。

解决方案 »

  1.   

    <!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=gb2312" /><style type="text/css">
    <!--
    body,td,th {
    font-size: 12px;
    }
    -->
    </style></head>
    <body>
    <div id="demo" style="overflow:hidden; width:300px; height:132px; line-height:20px;"> 
    <div id="demo1"> 
    11111111<br>
    11111111<br>
    11111111<br>
    11111111<br>
    11111111<br>
    11111111<br>
    11111111
    </div> 
    <div id="demo2"></div> 
    </div> 
     
    <script language="javascript"> 
    var speed=30 
    document.getElementById("demo2").innerHTML=document.getElementById("demo1").innerHTML 
    function Marquee(){ if(document.getElementById("demo2").offsetTop-document.getElementById("demo").scrollTop<=0) 
    document.getElementById("demo").scrollTop-=document.getElementById("demo1").offsetHeight 
    else{ 
    document.getElementById("demo").scrollTop++ 

    document.getElementById("a").innerHTML=document.getElementById("demo2").offsetTop-document.getElementById("demo").scrollTop;

    var MyMar=setInterval(Marquee,speed) 
    document.getElementById("demo").onmouseover=function() {clearInterval(MyMar)} 
    document.getElementById("demo").onmouseout=function() {MyMar=setInterval(Marquee,speed)} 
    </script> 
    <div id="a"></div>
    </body>
    </body>
    </html>
    你自己看就知道了
      

  2.   

    你复制我的代码测试以后你再把<div id="demo1"> 
    11111111<br>
    11111111<br>
    11111111<br>
    11111111<br>
    11111111<br>
    11111111<br>
    11111111
    </div> 
    这里,面的最后一行11111111删掉,你对比一下,然后仔细观察<div id="a"></div>
    这个的值的变化就知道了
      

  3.   

    在FIREFOX下,a的值,到了489就停止了
      

  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=gbk" />
    <title>test</title>
    <style>
    body {font: 12px, Arial, Helvetica, sans-serif;color: #808080;}
    a:visited, a:link {color: #808080; text-decoration: none;}
    a:hover {color: #2359B1;}
    #wrapper { margin:0 auto;width:960px; background-color:#FFF; height:auto; overflow: hidden;}
    #content{ width:960px; height:auto; overflow:hidden; clear:both;margin-top:10px;}
    #side{ FLOAT: left; OVERFLOW: hidden; WIDTH: 215px; HEIGHT: auto; BACKGROUND-COLOR: #fafafa}
    .cartbox{width:189px; border:5px solid #cccccc; margin-bottom:5px; margin-top:0px; line-height:25px; padding:8px;}
    .invoicequery{border: 1px solid #A5E26B; width:213px; margin-bottom:5px;}
    .invoicequery .title{ background:url(images/menu_bg.gif); height:27px;font-size:14px; font-weight:bold; line-height:25px; padding-left:10px; padding-top:6px;}
    .invoicequery .content{width:203px;border-top:1px dashed #DADADA; margin-left:5px; padding-top:5px; margin-bottom:0px; padding-bottom:5px;}
    .invoicequery .content .invoicebox ul{ height:18px; width:189px; margin:0px; margin-left:6px; padding-left:0px; padding-top:0px!important; padding-top:2px; padding-bottom:2px; background: #F7F7F7}
    .invoicequery .content .invoicebox .odb{border:1px dashed #DADADA;border-bottom:none}
    .invoicequery .content .invoicebox .ivb{border:1px dashed #DADADA; margin-bottom:5px;}
    .invoicequery .content .invoicebox li{ line-height:16px; list-style-type:none; float:left;}
    .invoicequery .content .invoicebox .tt{ width:60px; padding-left:6px; padding-top:2px!important; padding-top:3px;}
    #demo{overflow:hidden; height:148px!important; height:160px;}
    </style>
    </head>
    <body>
    <div id="wrapper">
    <div id="content">
    <div id="side">
    <div class="cartbox"><a href="../shop/mycart.php" title="查看购物车">您的购物车中有 0 件商品,总计金额 ¥0.00元。</a></div>
    <div class="invoicequery"> 
    <div class="title">发货单号查询</div>
    <div class="content">
    <div class="invoicebox">
    <div id="demo"> 
    <div id="demo1">
    <ul class="odb"><li class="tt">订货单号</li><li>2008100672310</li></ul>
    <ul class="ivb"><li class="tt">发货单号</li><li>34324323434</li></ul>
    <ul class="odb"><li class="tt">订货单号</li><li>2008100609437</li></ul>
    <ul class="ivb"><li class="tt">发货单号</li><li>frrrt</li></ul>
    <ul class="odb"><li class="tt">订货单号</li><li>2008100643652</li></ul>
    <ul class="ivb"><li class="tt">发货单号</li><li>3432432343</li></ul>
    <ul class="odb"><li class="tt">订货单号</li><li>2008100629784</li></ul>
    <ul class="ivb"><li class="tt">发货单号</li><li>3431112</li></ul>
    <ul class="odb"><li class="tt">订货单号</li><li>2008100666583</li></ul>
    <ul class="ivb"><li class="tt">发货单号</li><li>3333333333</li></ul>
    <ul class="odb"><li class="tt">订货单号</li><li>2008092583610</li></ul>
    <ul class="ivb"><li class="tt">发货单号</li><li>333333</li></ul>
    </div> 
    <div id="demo2"></div> 
    </div>
    </div>
    <script> 
    var speed=50 
    document.getElementById("demo2").innerHTML=document.getElementById("demo1").innerHTML 
    function Marquee(){ 
    if(document.getElementById("demo2").offsetTop-document.getElementById("demo").scrollTop<=0) 
    document.getElementById("demo").scrollTop-=document.getElementById("demo1").offsetHeight 
    else{ 
    document.getElementById("demo").scrollTop++ 


    var MyMar=setInterval(Marquee,speed) 
    document.getElementById("demo").onmouseover=function() {clearInterval(MyMar)} 
    document.getElementById("demo").onmouseout=function() {MyMar=setInterval(Marquee,speed)}
    </script>
    </div>
    </div>
    </div>
    </div>
    </div>
    </body>
    </html>这是我的代码,在FIREFOX下,每循环滚动2次就停止了。
    但如果直接把ID为invoicequery直接放在BODY里,就不会停止了。
    帮我看看问题出在哪里?
      

  5.   

    还是你这个的问题#demo{overflow:hidden; height:148px!important; height:160px;}
    你的JS只要改成:<script> 
    var speed=50 
    document.getElementById("demo2").innerHTML=document.getElementById("demo1").innerHTML 
    function Marquee(){ 
    if(document.getElementById("demo2").offsetTop-document.getElementById("demo").scrollTop<=0) 
    document.getElementById("demo").scrollTop-=document.getElementById("demo1").offsetHeight 
    else{ 
    document.getElementById("demo").scrollTop++ 

    document.getElementById("a").innerHTML=document.getElementById("demo2").offsetTop-document.getElementById("demo").scrollTop;

    var MyMar=setInterval(Marquee,speed) 
    document.getElementById("demo").onmouseover=function() {clearInterval(MyMar)} 
    document.getElementById("demo").onmouseout=function() {MyMar=setInterval(Marquee,speed)}
    </script>然后再加一个<div id="a"></div>你就发现,FF下a的值无法达到0,所以就停止了
      

  6.   

    如果我用上面我发的代码,我把#demo{overflow:hidden; height:148px!important; height:160px;} 改成height:144px!important的话,这时候A的值可以到0,而且循环也正常。但是如果我在SIDE里增加其他内容的话,A的值就又会停在一个指定的数字上。那就是说没办法了?
      

  7.   

    内容的高度和那个高度的统一
    DIV在IE和FF下的offsetTop值是不一样的
      

  8.   

    #demo{overflow:hidden; height:160px;POSITION: absolute;}
    就可以了