• javascript 图片切换


    <SCRIPT language=JavaScript> 
    <!-- // BannerAD 
          
    var bannerAD=new Array(); 
    var bannerADlink=new Array(); 
    var adNum=0; 
          
    bannerAD[0]="indexbanner/1.jpg"; 
    bannerADlink[0]="#"; 
    bannerAD[1]="indexbanner/2.jpg"; 
    bannerADlink[1]="#"; 
    bannerAD[2]="indexbanner/3.jpg"; 
    bannerADlink[2]="#"; 
    bannerAD[3]="indexbanner/4.jpg"; 
    bannerADlink[3]="#"; 
    bannerAD[4]="indexbanner/5.jpg"; 
    bannerADlink[4]="#"; 
    bannerAD[5]="indexbanner/6.jpg"; 
    bannerADlink[5]="#"; 
    bannerAD[6]="indexbanner/7.jpg"; 
    bannerADlink[6]="#"; 
    bannerAD[7]="indexbanner/8.jpg"; 
    bannerADlink[7]="#"; 
          
    var preloadedimages=new Array(); 
    for (i=0;i<bannerAD.length;i++){ 
    preloadedimages=new Image(); 
    preloadedimages.src=bannerAD; 

          
    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()", 3500); 

          
    function jump2url(){ 
    jumpUrl=bannerADlink[adNum]; 
    jumpTarget='_blank'; 
    if (jumpUrl != ''){ 
    if (jumpTarget != '')window.open(jumpUrl,jumpTarget); 
    else location.href=jumpUrl; 


    function displayStatusMsg() { 
    status=bannerADlink[adNum]; 
    document.returnValue = true; 

          
    //--> 
          
    </SCRIPT>
                <A onmouseover="displayStatusMsg();return document.returnValue" 
                href=""><IMG 
                style="FILTER: revealTrans(duration=2,transition=23)" 
                src="TungstenCore.files/1.jpg" border=0 name=bannerADrotator> </A>
                <SCRIPT language=JavaScript>nextAd()</SCRIPT>

    (2)
    <script language=JavaScript>
    var imgUrl=new Array();
    var imgLink=new Array();
    var adNum=0;
    imgUrl[1]="/images/qhdbanner1.gif"; 
    imgLink[1]=""; 
    imgUrl[2]="/images/qhdbanner2.gif"; 
    imgLink[2]=""; 


         var imgPre=new Array();
       for (i=1;i<3;i++){
    imgPre=new Image();
          imgPre.src=imgUrl;
       }


    function setTransition(){
       if (document.all){
          imgUrlrotator.filters.revealTrans.Transition=Math.floor(Math.random()*20);
          imgUrlrotator.filters.revealTrans.apply();
       }
    }

    function playTransition(){
       if (document.all)
          imgUrlrotator.filters.revealTrans.play()
    }


    function nextAd(){
       if(adNum<imgUrl.length-1)adNum++ ;
          else adNum=1;
       setTransition();
       document.images.imgUrlrotator.src=imgUrl[adNum];
       playTransition();
       theTimer=setTimeout("nextAd()", 6000);
    }

    function jump2url(){
       jumpUrl=imgLink[adNum];
       jumpTarget='_blank';
       if (jumpUrl != ''){
          if (jumpTarget != '')window.open(jumpUrl,jumpTarget);
          else location.href=jumpUrl;
       }
    }
    function displayStatusMsg() { 
       status=imgLink[adNum];
       document.returnValue = true;
    }
    </script>

    暂停之后调用

    <script language="javascript">
            function Pause(obj, iMinSecond) {
                if (window.eventList == null) window.eventList = new Array();
                var ind = -1;
                for (var i = 0; i < window.eventList.length; i++) {
                    if (window.eventList[i] == null) {
                        window.eventList[i] = obj;
                        ind = i;
                        break;
                    }
                }

                if (ind == -1) {
                    ind = window.eventList.length;
                    window.eventList[ind] = obj;
                }
                setTimeout("GoOn(" + ind + ")", iMinSecond);
            }


            function GoOn(ind) {
                var obj = window.eventList[ind];
                window.eventList[ind] = null;
                if (obj.NextStep) obj.NextStep();
                else obj();
            }

            function Start() {
                Pause(this, 10000); //调用暂停函数
                this.NextStep = function() {
                    nextAd();
                }
            } 
        </script>

  • 相关阅读:
    properties文件作用以及在哪些地方用
    UUID.randomUUID().toString() 的作用
    devops简介
    Redis数据库
    锁方面区别
    python如何操作git
    使用django实现websocket
    迁移与备份
    服务端主动给客户端推送消息
    使用vim登录root管理员用户显示su:鉴定故障
  • 原文地址:https://www.cnblogs.com/zwei1121/p/1796401.html
Copyright © 2020-2023  润新知