经典的js图片切换。。

 

<table width="535" height="215" border="0" cellpadding="0" cellspacing="0">

              <tr>

                            <td width="450" height="215">

                            <script language=JavaScript> //js代码              

                            var bannerAD=new Array(); //用于存放图片路径(相对路径)

                            var adNum=0;       

                            bannerAD[0]="imgs/ad1.jpg";

                            bannerAD[1]="imgs/ad2.jpg";

                            bannerAD[2]="imgs/ad3.jpg";

                            bannerAD[3]="imgs/ad4.jpg";

                            bannerAD[4]="imgs/ad5.jpg";

                            bannerAD[5]="imgs/ad6.jpg";   

                            function setTransition(){

                                          if (document.all){

                                          bannerADrotator.filters.revealTrans.Transition=Math.floor(Math.random()*23);//设置图片切换

                                                        bannerADrotator.filters.revealTrans.apply(); //应用图片切换

                                          }

                            }           

                            function playTransition(){

                                          if (document.all)

                                                        bannerADrotator.filters.revealTrans.play() //播放图片

                            }           

                            function nextAd(){

                                          if(adNum<bannerAD.length-1)adNum++;

                                          else adNum=0;

                                          setTransition();

                                          document.images.bannerADrotator.src=bannerAD[adNum];

                                          playTransition();

                                          theTimer=setTimeout("nextAd()", 5000); //5秒钟切换一张图片

                            }                         

                            </script>                           

                           <img style="FILTER: revealTrans(duration=2,transition=20)" height=292 src="" width=515 border=1 name=bannerADrotator>

                            <SCRIPT language=JavaScript>nextAd()</SCRIPT>

                            </td>

              </tr>

</table>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值