一段图片滚动的JS代码,在IE理可以,在火狐不能用,JS高手帮忙看下,谢谢了!

<html><head><metahttp-equiv="Content-Language"content="en"/><metaname="GENERATOR"cont... <html>
<head>
<meta http-equiv="Content-Language" content="en" />
<meta name="GENERATOR" content="Zend Studio" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>test1</title>
</head>
<body>
<table width="100%" border="0" cellpadding="4" cellspacing="1" bgcolor="B6B191">
<tr>
<td >
<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><img src=images/1.gif width=110 height=60 border=0></td></tr
<tr><td height=67 align=center><img src=images/1.gif width=110 height=60 border=0></td></tr>
<tr><td height=67 align=center><img src=images/1.gif width=110 height=60 border=0></td></tr>
</table>
</div>
<div id="article2" style="position:absolute;z-index:1;visibility:hidden"></div>
</td></tr>
</table>

<script language="javascript">
var 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()",20);
}
function scrollUp1(){
if(stopscrolla==true) return;
currentTopa+=1;
if(currentTopa==68) //比图片高度多1
{
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>
</body>
</html>
展开
 我来答
星灵运势
推荐于2016-12-04 · TA获得超过197个赞
知道答主
回答量:220
采纳率:0%
帮助的人:122万
展开全部
我自己给你重新做了一个图片滚动代码。IE.FF测试通过:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta name="Copyright" content="感情用饰 http://www.huer.net.cn/" />
<meta name="keywords" content="JS代码,图片特效,JS广告代码,JS特效代码" />
<meta name="description" content="此代码内容为垂直无接缝图片滚动代码,属于站长常用代码" />
<title>垂直无接缝图片滚动代码_感情用饰 阿虎</title>
<style type="text/css">
<!--
TD {FONT-SIZE: 12px;}
</style>
</head>

<body>
<div id=link_logo style="OVERFLOW: hidden; WIDTH: 190px; HEIGHT: 235px">
<div id=link_logo1 style="OVERFLOW: hidden">
<table cellspacing=0 cellpadding=0 width=180 border=0>
<tbody>
<tr>
<td valign=top align=middle height=33><table cellspacing=0 cellpadding=2 border=0>
<tbody>
<tr>
<td align=middle><a href="http://www.huer.net.cn/"
target=_blank><img
src="images/lanrentuku.gif" alt="" width="88" height="31"
border=0></a><a href="http://www.huer.net.cn/"
target=_blank></a></td>
</tr>
</tbody>
</table></td>
<td valign=top align=middle height=33><table cellspacing=0 cellpadding=2 border=0>
<tbody>
<tr>
<td align=middle><a href="http://www.huer.net.cn/"
target=_blank><img
src="images/lanrentuku.gif" alt="" width="88" height="31"
border=0></a></td>
</tr>
</tbody>
</table></td>
</tr>
<tr>
<td valign=top align=middle height=33><table cellspacing=0 cellpadding=2 border=0>
<tbody>
<tr>
<td align=middle><a href="http://www.huer.net.cn/"
target=_blank><img
src="images/lanrentuku.gif" alt="" width="88" height="31"
border=0></a><a href="http://www.huer.net.cn/"
target=_blank></a></td>
</tr>
</tbody>
</table></td>
<td valign=top align=middle height=33><table cellspacing=0 cellpadding=2 border=0>
<tbody>
<tr>
<td align=middle><a href="http://www.huer.net.cn/"
target=_blank><img
src="images/lanrentuku.gif" alt="" width="88" height="31"
border=0></a></td>
</tr>
</tbody>
</table></td>
</tr>
<tr>
<td valign=top align=middle height=33><table cellspacing=0 cellpadding=2 border=0>
<tbody>
<tr>
<td align=middle><a href="http://www.huer.net.cn/"
target=_blank><img
src="images/lanrentuku.gif" alt="" width="88" height="31"
border=0></a><a href="http://www.chinasspp.com/"
target=_blank></a></td>
</tr>
</tbody>
</table></td>
<td valign=top align=middle height=33><table cellspacing=0 cellpadding=2 border=0>
<tbody>
<tr>
<td align=middle><a href="http://www.huer.net.cn/"
target=_blank><img
src="images/lanrentuku.gif" alt="" width="88" height="31"
border=0></a></td>
</tr>
</tbody>
</table></td>
</tr>

<tr>
<td valign=top align=middle height=33><table cellspacing=0 cellpadding=2 border=0>
<tbody>
<tr>
<td align=middle><a href="http://www.huer.net.cn/"
target=_blank><img
src="images/lanrentuku.gif" alt="" width="88" height="31"
border=0></a><a href="http://www.chinasspp.com/"
target=_blank></a></td>
</tr>
</tbody>
</table></td>
<td valign=top align=middle height=33><table cellspacing=0 cellpadding=2 border=0>
<tbody>
<tr>
<td align=middle><a href="http://www.huer.net.cn/"
target=_blank><img
src="images/lanrentuku.gif" alt="" width="88" height="31"
border=0></a></td>
</tr>
</tbody>
</table></td>
</tr>
<tr>
<td valign=top align=middle height=33><table cellspacing=0 cellpadding=2 border=0>
<tbody>
<tr>
<td align=middle><a href="http://www.huer.net.cn/"
target=_blank><img
src="images/lanrentuku.gif" alt="" width="88" height="31"
border=0></a><a href="http://www.chinasspp.com/"
target=_blank></a></td>
</tr>
</tbody>
</table></td>
<td valign=top align=middle height=33><table cellspacing=0 cellpadding=2 border=0>
<tbody>
<tr>
<td align=middle><a href="http://www.huer.net.cn/"
target=_blank><img
src="images/lanrentuku.gif" alt="" width="88" height="31"
border=0></a></td>
</tr>
</tbody>
</table></td>
</tr>
<tr>
<td valign=top align=middle height=33><table cellspacing=0 cellpadding=2 border=0>
<tbody>
<tr>
<td align=middle><a href="http://www.huer.net.cn/"
target=_blank><img
src="images/lanrentuku.gif" alt="" width="88" height="31"
border=0></a><a href="http://www.chinasspp.com/"
target=_blank></a></td>
</tr>
</tbody>
</table></td>
<td valign=top align=middle height=33><table cellspacing=0 cellpadding=2 border=0>
<tbody>
<tr>
<td align=middle><a href="http://www.huer.net.cn/"
target=_blank><img
src="images/lanrentuku.gif" alt="" width="88" height="31"
border=0></a></td>
</tr>
</tbody>
</table></td>
</tr>

<tr>
<td valign=top align=middle height=33><table cellspacing=0 cellpadding=2 border=0>
<tbody>
<tr>
<td align=middle><a href="http://www.huer.net.cn/"
target=_blank><img
src="images/lanrentuku.gif" alt="" width="88" height="31"
border=0></a><a href="http://www.chinasspp.com/"
target=_blank></a></td>
</tr>
</tbody>
</table></td>
<td valign=top align=middle height=33><table cellspacing=0 cellpadding=2 border=0>
<tbody>
<tr>
<td align=middle><a href="http://www.huer.net.cn/"
target=_blank><img
src="images/lanrentuku.gif" alt="" width="88" height="31"
border=0></a></td>
</tr>
</tbody>
</table></td>
</tr>
<tr>
<td valign=top align=middle height=33><table cellspacing=0 cellpadding=2 border=0>
<tbody>
<tr>
<td align=middle><a href="http://www.huer.net.cn/"
target=_blank><img
src="images/lanrentuku.gif" alt="" width="88" height="31"
border=0></a><a href="http://www.chinasspp.com/"
target=_blank></a></td>
</tr>
</tbody>
</table></td>
<td valign=top align=middle height=33><table cellspacing=0 cellpadding=2 border=0>
<tbody>
<tr>
<td align=middle><a href="http://www.huer.net.cn/"
target=_blank><img
src="images/lanrentuku.gif" alt="" width="88" height="31"
border=0></a></td>
</tr>
</tbody>
</table></td>
</tr>
<tr>
<td valign=top align=middle height=33><table cellspacing=0 cellpadding=2 border=0>
<tbody>
<tr>
<td align=middle><a href="http://www.huer.net.cn/"
target=_blank><img
src="images/lanrentuku.gif" alt="" width="88" height="31"
border=0></a><a href="http://www.chinasspp.com/"
target=_blank></a></td>
</tr>
</tbody>
</table></td>
<td valign=top align=middle height=33><table cellspacing=0 cellpadding=2 border=0>
<tbody>
<tr>
<td align=middle><a href="http://www.huer.net.cn/"
target=_blank><img
src="images/lanrentuku.gif" alt="" width="88" height="31"
border=0></a></td>
</tr>
</tbody>
</table></td>
</tr>
<tr>
<td valign=top align=middle height=33><table cellspacing=0 cellpadding=2 border=0>
<tbody>
<tr>
<td align=middle><a href="http://www.huer.net.cn/"
target=_blank><img
src="images/lanrentuku.gif" alt="" width="88" height="31"
border=0></a><a href="http://www.chinasspp.com/"
target=_blank></a></td>
</tr>
</tbody>
</table></td>
<td valign=top align=middle height=33><table cellspacing=0 cellpadding=2 border=0>
<tbody>
<tr>
<td align=middle><a href="http://www.huer.net.cn/"
target=_blank><img
src="images/lanrentuku.gif" alt="" width="88" height="31"
border=0></a></td>
</tr>
</tbody>
</table></td>
</tr>
<tr>
<td valign=top align=middle height=33><table cellspacing=0 cellpadding=2 border=0>
<tbody>
<tr>
<td align=middle><a href="http://www.huer.net.cn/"
target=_blank><img
src="images/lanrentuku.gif" alt="" width="88" height="31"
border=0></a><a href="http://www.chinasspp.com/"
target=_blank></a></td>
</tr>
</tbody>
</table></td>
<td valign=top align=middle height=33><table cellspacing=0 cellpadding=2 border=0>
<tbody>
<tr>
<td align=middle><a href="http://www.huer.net.cn/"
target=_blank><img
src="images/lanrentuku.gif" alt="" width="88" height="31"
border=0></a></td>
</tr>
</tbody>
</table></td>
</tr>
<tr>
<td valign=top align=middle height=33><table cellspacing=0 cellpadding=2 border=0>
<tbody>
<tr>
<td align=middle><a href="http://www.huer.net.cn/"
target=_blank><img
src="images/lanrentuku.gif" alt="" width="88" height="31"
border=0></a><a href="http://www.chinasspp.com/"
target=_blank></a></td>
</tr>
</tbody>
</table></td>
<td valign=top align=middle height=33><table cellspacing=0 cellpadding=2 border=0>
<tbody>
<tr>
<td align=middle><a href="http://www.huer.net.cn/"
target=_blank><img
src="images/lanrentuku.gif" alt="" width="88" height="31"
border=0></a></td>
</tr>
</tbody>
</table></td>
</tr>
<tr>
<td valign=top align=middle height=33><table cellspacing=0 cellpadding=2 border=0>
<tbody>
<tr>
<td align=middle><a href="http://www.huer.net.cn/"
target=_blank><img
src="images/lanrentuku.gif" alt="" width="88" height="31"
border=0></a><a href="http://www.chinasspp.com/"
target=_blank></a></td>
</tr>
</tbody>
</table></td>
<td valign=top align=middle height=33><table cellspacing=0 cellpadding=2 border=0>
<tbody>
<tr>
<td align=middle><a href="http://www.huer.net.cn/"
target=_blank><img
src="images/lanrentuku.gif" alt="" width="88" height="31"
border=0></a></td>
</tr>
</tbody>
</table></td>
</tr>
<tr>
<td valign=top align=middle height=33><table cellspacing=0 cellpadding=2 border=0>
<tbody>
<tr>
<td align=middle><a href="http://www.huer.net.cn/"
target=_blank><img
src="images/lanrentuku.gif" alt="" width="88" height="31"
border=0></a><a href="http://www.chinasspp.com/"
target=_blank></a></td>
</tr>
</tbody>
</table></td>
<td valign=top align=middle height=33><table cellspacing=0 cellpadding=2 border=0>
<tbody>
<tr>
<td align=middle><a href="http://www.huer.net.cn/"
target=_blank><img
src="images/lanrentuku.gif" alt="" width="88" height="31"
border=0></a></td>
</tr>
</tbody>
</table></td>
</tr>
<tr>
<td valign=top align=middle height=33><table cellspacing=0 cellpadding=2 border=0>
<tbody>
<tr>
<td align=middle><a href="http://www.huer.net.cn/"
target=_blank><img
src="images/lanrentuku.gif" alt="" width="88" height="31"
border=0></a><a href="http://www.chinasspp.com/"
target=_blank></a></td>
</tr>
</tbody>
</table></td>
<td valign=top align=middle height=33><table cellspacing=0 cellpadding=2 border=0>
<tbody>
<tr>
<td align=middle><a href="http://www.huer.net.cn/"
target=_blank><img
src="images/lanrentuku.gif" alt="" width="88" height="31"
border=0></a></td>
</tr>
</tbody>
</table></td>
</tr>
<tr>
<td valign=top align=middle height=33><table cellspacing=0 cellpadding=2 border=0>
<tbody>
<tr>
<td align=middle><a href="http://www.huer.net.cn/"
target=_blank><img
src="images/lanrentuku.gif" alt="" width="88" height="31"
border=0></a><a href="http://www.chinasspp.com/"
target=_blank></a></td>
</tr>
</tbody>
</table></td>
<td valign=top align=middle height=33><table cellspacing=0 cellpadding=2 border=0>
<tbody>
<tr>
<td align=middle><a href="http://www.huer.net.cn/"
target=_blank><img
src="images/lanrentuku.gif" alt="" width="88" height="31"
border=0></a></td>
</tr>
</tbody>
</table></td>
</tr>
<tr>
<td valign=top align=middle height=33><table cellspacing=0 cellpadding=2 border=0>
<tbody>
<tr>
<td align=middle><a href="http://www.huer.net.cn/"
target=_blank><img
src="images/lanrentuku.gif" alt="" width="88" height="31"
border=0></a><a href="http://www.chinasspp.com/"
target=_blank></a></td>
</tr>
</tbody>
</table></td>
<td valign=top align=middle height=33><table cellspacing=0 cellpadding=2 border=0>
<tbody>
<tr>
<td align=middle><a href="http://www.huer.net.cn/"
target=_blank><img
src="images/lanrentuku.gif" alt="" width="88" height="31"
border=0></a></td>
</tr>
</tbody>
</table></td>
</tr>
</tbody>
</table>
</div>
<div id=link_logo2></div>
</div>
<p>
<script>
var speed=65
link_logo2.innerHTML=link_logo1.innerHTML
function Marquee2(){
if(link_logo2.offsetTop-link_logo.scrollTop<=0)
link_logo.scrollTop-=link_logo1.offsetHeight
else{
link_logo.scrollTop++
}
}
var MyMar2=setInterval(Marquee2,speed)
link_logo.onmouseover=function() {clearInterval(MyMar2)}
link_logo.onmouseout=function() {MyMar2=setInterval(Marquee2,speed)}
</script>
<br>
<br>
</p>
</body>
</html>
本回答被提问者采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式