2020年中国人均gdp排名:JAVA小程序的问题,大家看一下啊!

来源:百度文库 编辑:杭州交通信息网 时间:2024/04/28 01:42:17
<table width="140" border="0" cellspacing="0" align="center">
<tr>
<td>
<div id="article1" style="width:140;">
<TABLE cellSpacing="0" cellPadding="0" width="140" border="0">
<tr><td height=67 align=center>
<a href=http://www.webjx.com target=_blank><img src=/upfiles/specials/geren.jpg width=110 height=60 border=0></a></td></tr><tr><td height=67 align=center><a href=http://www.webjx.com target=_blank><img src=/upfiles/specials/action.jpg width=110 height=60 border=0></a></td></tr><tr><td height=67 align=center><a href=http://www.webjx.com target=_blank><img src=/upfiles/specials/flash1.jpg width=110 height=60 border=0></a></td></tr><tr><td height=67 align=center><a href=http://www.webjx.com target=_blank><img src=/upfiles/specials/aplet.jpg width=110 height=60 border=0></a></td></tr><tr><td height=67 align=center><a href=http://www.webjx.com target=_blank><img src=/upfiles/specials/flash.jpg width=110 height=60 border=0></a></td></tr><tr><td height=67 align=center><a href=http://www.webjx.com target=_blank><img src=/upfiles/specials/flash.jpg width=110 height=60 border=0></a></td></tr><tr><td height=67 align=center><a href=http://www.webjx.com target=_blank><img src=/upfiles/specials/net.jpg width=110 height=60 border=0></a>
</td>
</tr>
</TABLE>
</div>
<div id="article2" style="position:absolute;z-index:1;visibility:hidden"></div>
</td>
</tr>
</table>
<script language="javascript">
articleHeight=134;
stopscrolla=false;
article1.scrollTop=0;

with(article1){
style.width=0;
style.height=articleHeight;
style.overflowX="visible";
style.overflowY="hidden";
noWrap=true;
onmouseover=new Function("stopscrolla=true");
onmouseout=new Function("stopscrolla=false");
}

preTopa=0; currentTopa=0; stoptimea=0;

function init_srolltext1(){
article2.innerHTML="";
article2.innerHTML+=article1.innerHTML;
article1.innerHTML=article2.innerHTML+article2.innerHTML;
setInterval("scrollUp1()",50);
}
function scrollUp1(){
if(stopscrolla==true) return;
currentTopa+=1;
if(currentTopa==68)
{
stoptimea+=1;
currentTopa-=1;
if(stoptimea==50)
{
currentTopa=0;
stoptimea=0;
}
}
else {
preTopa=article1.scrollTop;
article1.scrollTop+=1;
if(preTopa==article1.scrollTop){
article1.scrollTop=article2.offsetHeight-articleHeight;
article1.scrollTop+=1;
}
}

}
init_srolltext1();
</script>
这段代码是图片向上滚动且有停顿的效果,但是我插到我的页面里发生了变化,刚开始滚动的位置对的了,时间越长,位置偏离越厉害,本来是在每行图片的下栏停顿一下,循环时间长了就到了图片中间停顿了,位置不准确,怎么回事啊,

有问题吗?

这个代码很正确。

顶多注意一下width="140"这个参数