日期:2014-05-17  浏览次数:21014 次

这代码怎么该滚动速度??
<DIV   id=marquees>  
<div   align= "center ">
<table   width= "179 "   Height= "280 "   border= "0 ">  
<tr>  
<td> www.ii86.com   荆网在线 </td>  
</tr>  
</table>  
</div>
</DIV>  
<SCRIPT>  

marqueesHeight=223;  
stopscroll=false;  
with(marquees){  
noWrap=true;  
style.width=0;  
style.height=marqueesHeight;  
style.overflowY= "hidden ";  

onmouseover=new   Function( "stopscroll=true ");  
onmouseout=new   Function( "stopscroll=false ");  
}  
document.write( ' <div   id= "templayer "   style= "position:absolute;z-index:1;visibility:hidden "> </div> ');  

function   init(){  
while(templayer.offsetHeight <marqueesHeight){  
templayer.innerHTML+=marquees.innerHTML;  
}  
marquees.innerHTML=templayer.innerHTML+templayer.innerHTML;  
setInterval( "scrollUp() ",5);  
}  
document.body.onload=init;  

preTop=0;  

function   scrollUp(){  
if(stopscroll==true)   return;  
preTop=marquees.scrollTop;  
marquees.scrollTop+=1;  

if(preTop==marquees.scrollTop){  
marquees.scrollTop=templayer.offsetHeight-marqueesHeight+1;  
}  
}  
-->  
</SCRIPT>

------解决方案--------------------
改变setInterval( "scrollUp() ",5);中的数字就行了,数字越大速度越慢
------解决方案--------------------
同意楼上的