92、图片轮回显示效果

92、图片轮回显示效果

脚本说明:

第一步:把如下代码加入<body>区域中

<script language=javaScript>

var i_strngth=1

var i_image=0

var imageurl = new Array()

imageurl[0] ="1840.gif"

imageurl[1] ="1841.gif"

imageurl[2] ="1842.gif"

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>

<div id="testimage" style="position:absolute;visibility:visible;top:120px;left:240px"></div>

 

 

第二步:把<body>中的内容改为:

<body bgcolor="#fef4d9" onLoad="showimage()">

Write a comment

Comments: 0