<table width="194" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><div id="marquees"> 
                    <p align="center"><a class="bar" href="1"><strong>test</strong></a></p>
                    <a class="bar" href="1">   
                    test<br>
                    test<br>
                    test。</a></div>
                  <script language="JavaScript">
marqueesHeight=80;
stopscroll=false;
with(marquees){
  style.width="190";
  style.height=marqueesHeight;
  style.overflowX="visible";
  style.overflowY="hidden";
  noWrap=true;
  onmouseover=new Function("stopscroll=true");
  onmouseout=new Function("stopscroll=false");
}
document.write('<div id="templayer" style="position:absolute;z-index:1;visibility:hidden"></div>');preTop=0; currentTop=0; function init(){
  templayer.innerHTML="";
  while(templayer.offsetHeight<marqueesHeight){
    templayer.innerHTML+=marquees.innerHTML;
  }
  marquees.innerHTML=templayer.innerHTML+templayer.innerHTML;
  setInterval("scrollUp()",90);
}
document.body.onload=init;function scrollUp(){
  if(stopscroll==true) return;
  preTop=marquees.scrollTop;
  marquees.scrollTop+=1;
  if(preTop==marquees.scrollTop){
    marquees.scrollTop=templayer.offsetHeight-marqueesHeight;
    marquees.scrollTop+=1;
  }
}
</script></td>
  </tr>
</table>

解决方案 »

  1.   

    我也晕
    反正在ie6的机器上显示正常
    ie5就不行:((((((((((((
      

  2.   

    呵呵,我刚才以为是(窗口滚动条).误会~
    多半是ie5不支持一些Dhtml对象的属性,方法.有没有报错啊?
      

  3.   

    我还发现另一个怪问题:
    如果去掉<div>外面的<table><tr><td>></td></tr></table>
    ie5显示就正常了!????????????????????/******************去掉<table>后的代码******************/<div id="marquees"> 
                        <p align="center"><a class="bar" href="1"><strong>test</strong></a></p>
                        <a class="bar" href="1">   
                        test<br>
                        test<br>
                        test。</a></div>
                      <script language="JavaScript">
    marqueesHeight=80;
    stopscroll=false;
    with(marquees){
      style.width="190";
      style.height=marqueesHeight;
      style.overflowX="visible";
      style.overflowY="hidden";
      noWrap=true;
      onmouseover=new Function("stopscroll=true");
      onmouseout=new Function("stopscroll=false");
    }
    document.write('<div id="templayer" style="position:absolute;z-index:1;visibility:hidden"></div>');preTop=0; currentTop=0; function init(){
      templayer.innerHTML="";
      while(templayer.offsetHeight<marqueesHeight){
        templayer.innerHTML+=marquees.innerHTML;
      }
      marquees.innerHTML=templayer.innerHTML+templayer.innerHTML;
      setInterval("scrollUp()",90);
    }
    document.body.onload=init;function scrollUp(){
      if(stopscroll==true) return;
      preTop=marquees.scrollTop;
      marquees.scrollTop+=1;
      if(preTop==marquees.scrollTop){
        marquees.scrollTop=templayer.offsetHeight-marqueesHeight;
        marquees.scrollTop+=1;
      }
    }
    </script>
      

  4.   

    to  DwNet(DwNet)
    ie没有报错