tonymoly好:JAVA难题

来源:百度文库 编辑:神马品牌网 时间:2024/05/02 08:47:21
<div id=icefable2><table width='100%' cellSpacing='5'><tr align='center' class='tdbg'>
<td width='88' bgcolor="#999900"> </td>
<td width='88' bgcolor="#CCCCCC"> </td>
</tr><tr align='center' class='tdbg'>
<td width='88' bgcolor="#996600"> </td>
<td width='88' bgcolor="#FF0000"> </td>
</tr><tr align='center' class='tdbg'>
<td width='88' bgcolor="#996699"> </td>
<td width='88' bgcolor="#FF00FF"> </td>
</tr><tr align='center' class='tdbg'>
<td width='88' bgcolor="#99CCFF"> </td>
<td width='88' bgcolor="#00FFFF"> </td>
</tr><tr align='center' class='tdbg'>
<td width='88' bgcolor="#CC9999"> </td>
<td width='88' bgcolor="#0000FF"> </td>
</tr><tr align='center' class='tdbg'>
<td width='88' bgcolor="#FF9966"> </td>
<td width='88' bgcolor="#00FF00"> </td>
</tr><tr align='center' class='tdbg'></tr></table>
<script>marqueesHeight=160;
stopscroll=false;
with(icefable2){
style.width=221;
style.height=marqueesHeight;
style.overflowX="visible";
style.overflowY="hidden";
noWrap=true;
onmouseover=new Function("stopscroll=true");
onmouseout=new Function("stopscroll=false");
}
preTop=0; currentTop=41; stoptime=0;
icefable2.innerHTML+=icefable2.innerHTML;
function init_srolltext(){
icefable2.scrollTop=0;
setInterval("scrollUp()",50);
}init_srolltext();
function scrollUp(){
if(stopscroll==true) return;
currentTop+=1;
if(currentTop==42)
{
stoptime+=1;
currentTop-=1;
if(stoptime==40)
{
currentTop=0;
stoptime=0;
}
}
else {
preTop=icefable2.scrollTop;
icefable2.scrollTop+=1;
if(preTop==icefable2.scrollTop){
icefable2.scrollTop=41;
icefable2.scrollTop+=1;
}
}
}
</script></div>

这个代码会在网页中向上流动.每次41.
我现在想改成向左流动,每次80。
应该怎么改。。。。。。
回答者:lingjie2008 - 童生 一级 4-7 16:24
好象还是不行~是不是那里还有错的

preTop=0; currentTop=41; stoptime=0;
icefable2.innerHTML+=icefable2.innerHTML;
function init_srolltext(){
icefable2.scrollTop=0;
setInterval("scrollUp()",50);
}init_srolltext();
function scrollUp(){
你把这里面的up换成left在把41改成80就可以了

java难题?拜托~不要把java和javascript弄混了

支持