<!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>
</head>
<style type="text/css">
body { margin:0;}
#main { width:450px; height:300px;}
#mann { width:450px; height:250px; position:relative; overflow:hidden;}
#yundong img { margin:0px; padding:0px; display:block;}
</style>
<script type="text/javascript">
function fun()
{
for(var i=0;i<50;i++)
        {
    var t=parseInt(document.getElementById("yundong").style.bottom);
    document.getElementById("yundong").style.bottom=t-5+"px";
alert("asd");
}
}
function funa()
{
    //document.getElementById("yundong").style.marginTop+=50;
    //alert(document.getElementById("yundong").style.top);
    var t=parseInt(document.getElementById("yundong").style.bottom);
    document.getElementById("yundong").style.bottom=t+250+"px";
}
</script>
<body>
<div id="main">
<div id="mann">
<span id="yundong" style="position:absolute; bottom:0px; top:auto;">
<img src="image/1244395165968_mthumb.jpg" width="450" height="250" />
<img src="image/1244395166659_mthumb.jpg" width="450" height="250" />
<img src="image/1244395166675_mthumb.jpg" width="450" height="250" />
<img src="image/1244395305256_mthumb.jpg" width="450" height="250" />
<img src="image/1244395306033_mthumb.jpg" width="450" height="250" />
</span>
</div>
<input name="" type="button" onclick="fun()" value="top"/>
<input type="submit" name="button" id="button" value="bottom" onclick="funa()" />
</div>
</body>
</html>麻烦大家都来看看,网上的无缝小弟看不懂。 自己想的一个,通过按钮fun()函数 改变图片top的值.循环50次,每次增加5PX
图片高度250px,从而达到无缝效果。  傻办法。问题是现在是。如果我在for循环体最下面加上一个alert它才能每次加5PX
但是它会弹出50个alert  。 昏迷中我。  如果取消alert 循环50次就没效果了.不是每次+5 跟没加循环没区别。
不知道大家看懂了没?为什么这循环在这就没用了呢。   for(var i=0;i<50;i++)
        {
    var t=parseInt(document.getElementById("yundong").style.bottom);
    document.getElementById("yundong").style.bottom=t-5+"px";
alert("asd");
}