改好了。<!--
function _InitScroll(_S1,_S2,_W,_H,_T,_V){
 return "var marqueesHeight"+_S1+"="+_H+";var stopscroll"+_S1+"=false;var scrollElem"+_S1+"=document.getElementById('"+_S1+"');with(scrollElem"+_S1+"){style.width="+_W+";style.height=marqueesHeight"+_S1+";style.overflow='hidden';noWrap=true;}scrollElem"+_S1+".onmouseover=new Function('stopscroll"+_S1+"=true');scrollElem"+_S1+".onmouseout=new Function('stopscroll"+_S1+"=false');var preTop"+_S1+"=0; var currentTop"+_S1+"=0; var stoptime"+_S1+"=0;var leftElem"+_S2+"=document.getElementById('"+_S2+"');scrollElem"+_S1+".appendChild(leftElem"+_S2+".cloneNode(true));setTimeout('init_srolltext"+_S1+"()',"+_T+");function init_srolltext"+_S1+"(){scrollElem"+_S1+".scrollTop=0;setInterval('scrollUp"+_S1+"()',"+_V+");}function scrollUp"+_S1+"(){if(stopscroll"+_S1+"){return;}currentTop"+_S1+"+=1;if(currentTop"+_S1+"==(marqueesHeight"+_S1+"+1)) {stoptime"+_S1+"+=1;currentTop"+_S1+"-=1;if(stoptime"+_S1+"=="+_T/50+") {currentTop"+_S1+"=0;stoptime"+_S1+"=0;}}else{preTop"+_S1+"=scrollElem"+_S1+".scrollTop;scrollElem"+_S1+".scrollTop +=1;if(preTop"+_S1+"==scrollElem"+_S1+".scrollTop){scrollElem"+_S1+".scrollTop=0;scrollElem"+_S1+".scrollTop +=1;}}}";
}eval(_InitScroll("A1","A2",616,315,3000,5));
//a1,a2,宽,高,停顿3000毫秒(必须大于50),速度为5
//-->
</SCRIPT>

解决方案 »

  1.   

    你的代码太乱,偶看不清,我刚帮别人解决了一个类似问题,你可以贴着看看。
    很好用的,设两个变量,得用取模来获取时间差。
    <script language=javascript defer>
     marqueeDiv1.childOffsetWidth=marqueeDiv1.children[0].offsetWidth;
     marqueeDiv1.insertAdjacentHTML("beforeEnd",marqueeDiv1.innerHTML+marqueeDiv1.innerHTML);
     var i = 0;
     var j = 1;
     window.setInterval(pause_it,60);
     function  pause_it()
     {
    ///时间间隔 ,改变值,即可伸缩时间
     if (i%10 == 0)
     {
     if(j++ %20) return;
     }
      marqueeDiv1.scrollLeft=(marqueeDiv1.scrollLeft+marqueeDiv1.tempSpeed*1)%marqueeDiv1.childOffsetWidth;
     
     
     i++;
     }
     
    </script>
    <div id=marqueeDiv1 nowrap style="width:300;overflow:hidden;background-color:#cccccc;" defaultSpeed=2 tempSpeed=2 onmouseOver="this.tempSpeed=0;" onmouseOut="this.tempSpeed=this.defaultSpeed;"> 
    <span style="width:180;"> 
    <table border="0" cellspacing="7" cellpadding="0">
    <tr> 
    <td width="50"><img src="img/1.jpg" width="50" height="100" alt="图片一"></td>
    <td width="50"><img src="img/2.jpg" width="50" height="100" alt="图片二"></td>
    <td width="50"><img src="img/3.jpg" width="50" height="100" alt="图片三"></td>
    <td width="50"><img src="img/4.jpg" width="50" height="100" alt="图片四"></td>
    <td width="50"><img src="img/5.jpg" width="50" height="100" alt="图片五"></td>
    </tr>
    </table>
    </span>
    </div>
      

  2.   

    随便请问一下,
    2 楼的代码我的机子上报错,什么也出不来。
    行6,字符1
    错误:null 为空或不为对象
    代码0