帮我该下JS,一个点击图片变换的效果,谢谢大家了
这是个鼠标点击一下图片,自动变换到下一张图片。<BODYbgcolor=#000005><DIValign=center><SCRIPTlanguage=JavaScri...
这是个鼠标点击一下图片,自动变换到下一张图片。
<BODY bgcolor=#000005>
<DIV align=center>
<SCRIPT language=JavaScript>
<!--
if (document.all){
document.write('<img src="ab1.jpg" id="box">');
}
//-->
</SCRIPT>
<CENTER></CENTER>
<SCRIPT language=JavaScript>
<!--
if (document.all){
pics=new Array(
"ab2.jpg")//
//Transition speed. 1000 = 1 seconds etc.
delay=1000;
//Nothing needs altering paste here.
l=new Array()
for (i=0; i < pics.length;i++){
l[i]=new Image()
l[i].src=pics[i]
}
n="progid:DXImageTransform.Microsoft.";
f=new Array()
f[0]="RandomDissolve(duration=1)";
f[1]="RandomDissolve(duration=1)";
f[2]="RandomDissolve(duration=1)";
f[3]="RandomDissolve(duration=1)";
f[4]="RandomDissolve(duration=1)";
f[5]="RandomDissolve(duration=1)";
f[6]="RandomDissolve(duration=1)";
f[7]="RandomDissolve(duration=1)";
f[8]="RandomDissolve(duration=1)";
f[9]="RandomDissolve(duration=1)";
f[10]="RandomDissolve(duration=1)";
f[11]="Blinds(Bands=10,direction=up)";
f[12]="Blinds(Bands=10,direction=up)";
f[13]="Blinds(Bands=10,direction=up)";
f[14]="Blinds(Bands=10,direction=up)";
f[15]="Blinds(Bands=10,direction=up)";
f[16]="Blinds(Bands=10,direction=up)";
f[17]="Blinds(Bands=10,direction=up)";
imgstep=0;
function ani(){
rnd=f[Math.floor(Math.random()*f.length)]
box.style.filter=n+rnd;
box.filters[0].apply();
box.src=l[imgstep].src;
box.filters[0].play();
imgstep++;
if (imgstep >= l.length) imgstep=0;
setTimeout("ani()",delay);
}
window.onload=new Function("setTimeout('ani()',delay)")
}
//-->
</SCRIPT>
-------------现在需要的是:不点击图片时候,图片也能自动变换到下一张,谢谢大家了,万分感谢 展开
<BODY bgcolor=#000005>
<DIV align=center>
<SCRIPT language=JavaScript>
<!--
if (document.all){
document.write('<img src="ab1.jpg" id="box">');
}
//-->
</SCRIPT>
<CENTER></CENTER>
<SCRIPT language=JavaScript>
<!--
if (document.all){
pics=new Array(
"ab2.jpg")//
//Transition speed. 1000 = 1 seconds etc.
delay=1000;
//Nothing needs altering paste here.
l=new Array()
for (i=0; i < pics.length;i++){
l[i]=new Image()
l[i].src=pics[i]
}
n="progid:DXImageTransform.Microsoft.";
f=new Array()
f[0]="RandomDissolve(duration=1)";
f[1]="RandomDissolve(duration=1)";
f[2]="RandomDissolve(duration=1)";
f[3]="RandomDissolve(duration=1)";
f[4]="RandomDissolve(duration=1)";
f[5]="RandomDissolve(duration=1)";
f[6]="RandomDissolve(duration=1)";
f[7]="RandomDissolve(duration=1)";
f[8]="RandomDissolve(duration=1)";
f[9]="RandomDissolve(duration=1)";
f[10]="RandomDissolve(duration=1)";
f[11]="Blinds(Bands=10,direction=up)";
f[12]="Blinds(Bands=10,direction=up)";
f[13]="Blinds(Bands=10,direction=up)";
f[14]="Blinds(Bands=10,direction=up)";
f[15]="Blinds(Bands=10,direction=up)";
f[16]="Blinds(Bands=10,direction=up)";
f[17]="Blinds(Bands=10,direction=up)";
imgstep=0;
function ani(){
rnd=f[Math.floor(Math.random()*f.length)]
box.style.filter=n+rnd;
box.filters[0].apply();
box.src=l[imgstep].src;
box.filters[0].play();
imgstep++;
if (imgstep >= l.length) imgstep=0;
setTimeout("ani()",delay);
}
window.onload=new Function("setTimeout('ani()',delay)")
}
//-->
</SCRIPT>
-------------现在需要的是:不点击图片时候,图片也能自动变换到下一张,谢谢大家了,万分感谢 展开
2009-06-01
展开全部
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询