图片的渐显播放:多个图片进行渐显轮换播放

[复制链接]
查看1395 | 回复1 | 2007-5-22 00:46:57 | 显示全部楼层 |阅读模式
1、将下面的代码插入到HEML的<head></head>之间(红色与红色图片地址相同、紫色与紫色图片地址相同、黄色与黄色图片地址相同): <script language=javaScript>
<!--//
sandra0 = new Image();
sandra0.src = "Picture4.jpg";
sandra1 = new Image();
sandra1.src = "Picture5.jpg";
sandra2 = new Image();
sandra2.src = "Picture4.jpg";
var i_strngth=1
var i_image=0
var imageurl = new Array()
imageurl[0] ="Picture4.jpg"
imageurl[1] ="Picture5.jpg"
imageurl[2] ="Picture4.jpg"
function showimage() {
if(document.all) {
if (i_strngth <=110) {
testimage.innerHTML="<img style='filter:alpha(opacity="+i_strngth+")' src="+imageurl[i_image]+" border=0>";
i_strngth=i_strngth+10
var timer=setTimeout("showimage()",100)
}
else {
clearTimeout(timer)
var timer=setTimeout("hideimage()",1000)
}
}
if(document.layers) {
clearTimeout(timer)
document.testimage.document.write("<img src="+imageurl[i_image]+" border=0>")
document.close()
i_image++
if (i_image >= imageurl.length) {i_image=0}
var timer=setTimeout("showimage()",2000)
}
}
function hideimage() {
if (i_strngth >=-10) {
testimage.innerHTML="<img style='filter:alpha(opacity="+i_strngth+")' src="+imageurl[i_image]+" border=0>";
i_strngth=i_strngth-10
var timer=setTimeout("hideimage()",100)
}
else {
clearTimeout(timer)
i_image++
if (i_image >= imageurl.length) {i_image=0}
i_strngth=1
var timer=setTimeout("showimage()",500)
}
}
//-->
</script>
2、修改<body>语句为:
<body >
3、将下面的代码加入到HEML的<body></body>之间:
<div id="testimage" style="position:absolute;visibili">

点击打开看演示: 多个图片进行渐显轮换播放.htm (1.72 KB, 下载次数: 17)
jack | 2007-5-22 23:56:02 | 显示全部楼层
这个也很好,顶一下~~~
您需要登录后才可以回帖 登录 | 注册

本版积分规则