为你而来

javascript:图片播放器

 1 <html>
 2 <head>
 3 <title>1</title>
 4 <style type='text/css'>
 5 img{
 6     /*FILTER: progid:DXImageTransform.Microsoft.Wipe(GradientSize=1.0,wipeStyle=0, motion='forward');*/
 7     /*filter:blendTrans(Duration=3);*/
 8 }
 9 </style>
10 </head>
11 <body>
12 <img src='d.jpg' id='imgx' width='300' height='200'/><br/><br/><br/>
13 <script language='javascript'>
14     var obj=document.getElementById('imgx');
15     var array=['a.jpg','b.jpg','c.jpg','d.jpg'];
16     var index=0;
17     var seconds=2;
18     function fun(){
19         obj.style.filter="RevealTrans(Transation="+ parseInt(Math.random()*21+1) +")";  
20         obj.filters[0].Apply();
21         obj.filters[0].play(duration = seconds);
22         obj.src=array[index];//这段代码要写在最后,否则播放一遍就没有效果了
23         if(index==3){
24             index=0;
25             //seconds=(seconds==2?3:2);
26             //obj.style.filter="blendTrans(Duration=3)"; 
27             //6-34.html
28         }
29         else
30             index++;
31     }
32     window.setInterval("fun();",3500);
33 </script>
34 </body>
35 </html>

 

posted on 2012-06-17 20:14  为你而来  阅读(277)  评论(0编辑  收藏  举报

导航