<script language=JavaScript> //js代码                                           var bannerAD=new Array(); //用于存放图片路径(相对路径)
                            var imgLink=new Array();                            var adNum=0;                                    bannerAD[0]="http://www.dayifs.com/Templets/index_new/img/topad.gif";                            bannerAD[1]="http://www.dayifs.com/Templets/index_new/img/zuo-01.gif";                            imgLink[1]="http://www.googdu.com.cn/";                            imgLink[2]="http://www.baidu.com/";                            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()", 3000); //3秒钟切换一张图片                            }                            function goUrl(){
                                               window.open(imgLink[adNum],'_blank');
                                            }                                                      </script>                              <a href='javascript:goUrl()'>
                                                    <img style="FILTER: revealTrans(duration=2,transition=20)" src="javascript:NextPic()" width=515 border=0 name=bannerADrotator width="600" height="85"></a>                            <SCRIPT language=JavaScript>nextAd()</SCRIPT>

解决方案 »

  1.   

    你那个imgLink数组的下标应该是从0开始就对了!
    imgLink[1]="http://www.googdu.com.cn/";
    imgLink[2]="http://www.baidu.com/";
    改成imgLink[0]="http://www.googdu.com.cn/";
    imgLink[1]="http://www.baidu.com/";
      

  2.   


    <!Doctype html public '-//w3c//dtd xhtml 1.0 transitional//en' 'http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd'>
    <html xmlns='http://www.w3.org/1999/xhtml'>
    <head>
    <script language='javascript' type='text/javascript'>
    var bannerAD=new Array(); //用于存放图片路径(相对路径)
    var imgLink=new Array();
    var adNum=0;
    bannerAD[0]="http://www.dayifs.com/Templets/index_new/img/topad.gif";
    bannerAD[1]="http://www.dayifs.com/Templets/index_new/img/zuo-01.gif";
    imgLink[0]="http://www.googdu.com.cn/";
    imgLink[1]="http://www.baidu.com/";
    function setTransition(){
    if (document.all){
    document.getElementById('bannerADrotator').filters.revealTrans.Transition=Math.floor(Math.random()*23); //设置图片切换
    document.getElementById('bannerADrotator').filters.revealTrans.apply(); //应用图片切换
    }
    }
    function playTransition(){
    if (document.all)
    document.getElementById('bannerADrotator').filters.revealTrans.play() //播放图片
    }function nextAd(){
    if(adNum<bannerAD.length-1)adNum++;
    else adNum=0;
    setTransition();
    document.getElementById('bannerADrotator').src=bannerAD[adNum];
    playTransition();
    theTimer=setTimeout("nextAd()", 3000); //3秒钟切换一张图片
    }
    function goUrl(){
    window.open(imgLink[adNum],'_blank');
    }
    </script>
    </head>
    <body>
    <a href='javascript:goUrl()'>
    <img style="FILTER: revealTrans(duration=2,transition=20)" src="javascript:NextPic()" width=515 border=0 id='bannerADrotator'
    width="600" height="85"></a>
    <script language='javascript' type='text/javascript'>nextAd();</script>
    </body>
    </html>楼主数第二个数组 定义的问题 你看第一个是 0,1第二个是 1,2