<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>图片淡入淡出</title> <style type="text/css"> <!-- body{ background:#000000 } img{ filter:BlendTrans(duration=2); border:none; } --> </style> </head>
<body> <script language="javascript"> function img1(x){ this.length=x; } iname = new img1(5); iname[0]="1.jpg"; iname[1]="2.jpg"; iname[2]="3.jpg"; iname[3]="4.jpg"; iname[4]="5.jif"; var i=0; function play1(){ if(i==4){i=0;} else{i++;} tp1.filters[0].apply(); tp1.src=iname[i]; tp1.filters[0].play(); mytimeout=setTimeout("play1()",4000); } </script> <p><img src="1.jpg" name="tp1" /> <script language="javascript">play1()</script> </body> </html>