图片循环播放代码。。。
我想要图片循环播放的代码,
[解决办法]
参见这篇文章
http://bbs.csdn.net/topics/390415081
[解决办法]
可以用marquee属性实现。
[解决办法]
用marquee标签,如下:
<marquee behavior="scroll" direction="down" width="550" height="1000" scrollamount="4" scrolldelay="2">
<a href="daqiaolj.html"><img src="images/daqiao/jtdq.jpg" width="350" height="280" title="金塘大桥"/></a><a href="daqiaolj.html"><span class="STYLE43">金塘大桥</span></a>
<p><a href="daqiaolj.html"><img src="images/daqiao/岑港大桥.jpg" width="350" height="280" title="岑港大桥" /><span class="STYLE43">岑港大桥</span></a></p>
<p><a href="daqiaolj.html"><img src="images/daqiao/桃夭门大桥.jpg" width="350" height="280" title="桃夭门大桥" /><span class="STYLE43">桃夭门大桥</span></a></p>
<p><a href="daqiaolj.html"><img src="images/daqiao/响礁门大桥.jpg" width="350" height="280" title="响礁门大桥" /><span class="STYLE43">响礁门大桥</span></a></p>
<p><a href="daqiaolj.html"><img src="images/daqiao/新城大桥.jpg" width="350" height="280" title="新城大桥" /> <span class="STYLE43">新城大桥</span></a></p>
<p><a href="daqiaolj.html"><img src="images/daqiao/西堠门大桥.jpg" width="350" height="280" title="西堠门大桥" /> <span class="STYLE43">西堠门大桥</span></a></p>
</p>
</marquee>
[解决办法]
不知道你要的横向滚动还是纵向滚动,贴的是纵向:
<!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>
<script>
var timer;
function Start()
{
document.getElementById("adv").innerHTML+=document.getElementById("adv").innerHTML;
timer=window.setTimeout("Move()",10);
}
function Move()
{
var cover=document.getElementById("cover");
var adv=document.getElementById("adv");
if(cover.scrollTop<=adv.offsetHeight/2)
{
cover.scrollTop+=2;
}
else
{
cover.scrollTop=0;
}
window.status=cover.scrollTop;
timer=window.setTimeout("Move()",10);
}
</script>
</head>
<body onload="Start()">
<div id="cover" style="width:360px; height:300px;overflow:hidden;">
<div id="adv" style="width:360px; height:1520px;"><img src="images/ad-01.jpg" width="360" height="190" /><img src="images/ad-02.jpg" width="360" height="190" /><img src="images/ad-03.jpg" width="360" height="190" /><img src="images/ad-04.jpg" width="360" height="190" /></div>
</div>
</body>
</html>