读书人

这代码如何该滚动速度?

发布时间: 2012-03-13 11:21:12 作者: rapoo

这代码怎么该滚动速度??
<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);中的数字就行了,数字越大速度越慢
[解决办法]
同意楼上的

读书人网 >ASP

热点推荐