这是js代码 是不是图片太多的原因 还是图片太大的原因
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>左右无间断滚动</title>
<style type="text/css" media="all">
body,ul,li{margin:0px;padding:0px;}
.d1 { background:#ffffff;width:990px; height:160px;margin-left:0px;border:1px solid #999999;overflow:hidden; border:0;}
.div2 {float:left; border:0;}
ul{list-style:none;margin-top:5px;margin-bottom:5px;}
li{float:left; border:1px solid #999999;width:180px; height:140px; margin-left:8px;}
li img{ margin:5px; padding:0;}
.clear{width:0px;height:0px;margin:0px;padding:0px;line-height:0px;font-size:0px;clear:both;}
.d11 {background:#ffffff;width:990px; height:160px;margin-left:0px;border:1px solid #999999;overflow:hidden; border:0;}
.d111 {background:#ffffff;width:990px; height:160px;margin-left:0px;border:1px solid #999999;overflow:hidden; border:0;}
.d1111 {background:#ffffff;width:990px; height:160px;margin-left:0px;border:1px solid #999999;overflow:hidden; border:0;}
</style>
<script language="javascript" type="text/javascript">
var s,s2,s3,s4,timer;
function init(){
s=getid("div1");
s2=getid("div2");
s3=getid("div3");
s4=getid("scroll");
s4.style.width=(s2.offsetWidth*3)+"px";
s3.innerHTML=s2.innerHTML;
timer=setInterval(mar,30)
}
function mar(){
if(s2.offsetWidth<=s.scrollLeft){
s.scrollLeft-=s2.offsetWidth;
}else{s.scrollLeft++;}
}
function getid(id){
return document.getElementById(id);
}
window.onload=init;
</script>
</head>
<body>
<div class="d1111" id="div1" onmouseover="clearInterval(timer)" onmouseout="timer=setInterval(mar,30)">
<div class="scroll" id="scroll">
<div class="div2" id="div2">
<ul>
<li><a href="
http://www.cihpc.com/news_show.asp?id=191" target="_blank"><img src="images/tu1.jpg" alt="" width="170" height="130" border="0" /></a></li>
<li><a href="
http://www.cihpc.com/news_show.asp?id=191" target="_blank"><img src="images/tu2.jpg" alt="" width="170" height="130" border="0" /></a></li>
<li><a href="
http://www.cihpc.com/news_show.asp?id=191" target="_blank"><img src="images/tu3.jpg" alt="" width="170" height="130" border="0" /></a></li>
<li><a href="
http://www.cihpc.com/news_show.asp?id=191" target="_blank"><img src="images/tu4.jpg" alt="" width="170" height="130" border="0" /></a></li>
<li><a href="
http://www.cihpc.com/news_show.asp?id=191" target="_blank"><img src="images/tu5.jpg" alt="" width="170" height="130" border="0" /></a></li>
<li><a href="
http://www.cihpc.com/news_show.asp?id=191" target="_blank"><img src="images/tu6.jpg" alt="" width="170" height="130" border="0" /></a></li>
</ul>
</div>
<div id="div3" class="div2"></div>
<div class="clear"></div>
</div>
</div>
</body>
</html>
这里有一个无缝滚动效果
你把文字换图片就行了
参考一下
你说的一会是枣粗塌多长时凳谨间
至少在我测试中是正确的
造成这种现象的原因不是因为图凳圆片太多
往往是图片小于div宽度的时候滚动几秒钟就停止了
测试正常,IE和FireFox下面运行都没问题,请问你是用什么浏览器的?