js特效:图片轮换(仿FLASH)

 1  < div  align ="center" >  
 2           < div  id ="oTransContainer"  style ="FILTER: progid:DXImageTransform.Microsoft.Wipe(GradientSize=1.0,wipeStyle=0, motion='forward'); WIDTH: 698px; HEIGHT: 105px; overflow:hidden;" >
 3           < href ="#"  target ="_blank" >< img  id ="oDIV1"  style ="BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-BOTTOM: black 1px solid"  src ="images/index_47.jpg"  border ="0"  width ="698"  height ="105" ></ a >
 4           < href ="#"  target ="_blank" >< img  id ="oDIV2"  style ="BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-BOTTOM: black 1px solid"  src ="images/2.jpg"  border ="0"  width ="698"  height ="105" ></ a >
 5           < href ="#"  target ="_blank" >< img  id ="oDIV3"  style ="BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-BOTTOM: black 1px solid"  src ="images/3.jpg"  border ="0"  width ="698"  height ="105" ></ a >
 6           </ div >
 7       </ div >
 8       < script  type ="text/javascript" >
 9           var  NowFrame  =   1 ;
10           var  MaxFrame  =   3 ;
11           var  bStart  =   0 ;
12           function  fnToggle() {
13               var  next  =  NowFrame  +   1 ;
14 
15               if  (next  ==  MaxFrame  +   1 ) {
16                  NowFrame  =  MaxFrame;
17                  next  =   1 ;
18              }
19 
20               if  (bStart  ==   0 ) {
21                  bStart  =   1 ;
22 
23                  setTimeout( ' fnToggle() ' 3500 );
24 
25                   return ;
26              }
27               else  {
28                  oTransContainer.filters[ 0 ].Apply();
29                  document.getElementById( ' oDIV '   +  next).style.display  =   "" ;
30                  document.getElementById( ' oDIV '   +  NowFrame).style.display  =   " none " ;
31 
32                  oTransContainer.filters[ 0 ].Play(duration  =   2 );
33 
34                   if  (NowFrame  ==  MaxFrame)
35                      NowFrame  =   1 ;
36                   else
37                      NowFrame ++ ;
38              } setTimeout( ' fnToggle() ' 3500 );
39          }
40 
41          fnToggle();
42  </ script >

 

你可能感兴趣的:(Flash)