zoukankan      html  css  js  c++  java
  • js 自动执行方法

    <script type="text/javascript">
      var count=0;
      function ClickImageSwap(id)
      {
       if(id==5)
        id=count;
       if(count==2)
        count=0;
       var tempImage=document.getElementById("TempImage");
       if(id==0)
       {
        tempImage.src="images/topt1.jpg";
       }
       else if(id==1)
       {
        tempImage.src="images/topt2.jpg";
       }
       else if(id==2)
       {
        tempImage.src="images/topt3.jpg";
       }
       count++;
       setTimeout("ClickImageSwap(5)",3000);
      }
     </script>

    <script type="text/javascript">
      var count=0;
      var b = true;
      function ImageSwap()
      {
       if(b)
       {
        if(count > 2)
        {
         count = 0;
        }
        else
        {
         count++;
        }
        ClickImageSwap(count);
        setTimeout("ImageSwap()",5000);
       }
      }
      
      function ClickImageSwap(id)
      {
       var tempImage=document.getElementById("TempImage");
       if(id==0)
       {
        tempImage.src="images/topt1.jpg";
       }
       else if(id==1)
       {
        tempImage.src="images/topt2.jpg";
       }
       else if(id==2)
       {
        tempImage.src="images/topt3.jpg";
       }
      }
      
      function Out(id)
      {
       b = true;
       count = id;
       ImageSwap();
      }
      
      function In(id)
      {
       b = false;
       ClickImageSwap(id);
      }
      
      ImageSwap();
      
     </script>

  • 相关阅读:
    layui 动态设置radio选中
    C# ling 查询 in 用法
    sql 去除小数点后面无效的0
    VUE 全局变量申明和取值
    SQL 逗号分隔将一行拆成多行
    devexpress 延长试用期 licenses.licx
    BugkuCTF-WEB4
    一招破解网页复制+网页上如何实现禁止复制粘贴
    JS的函数
    JS的数组
  • 原文地址:https://www.cnblogs.com/xsmhero/p/1788881.html
Copyright © 2011-2022 走看看