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>

  • 相关阅读:
    如何使用gitbash 把你的代码托管到github
    发送邮件错误常见错误码
    使用snipworks/php-smtp发送邮件
    微信支付demo
    Linux——ps命令
    数组对象互转
    变量名下划线和驼峰互转
    对象数组转换
    curl请求
    百度地图接口的使用
  • 原文地址:https://www.cnblogs.com/xsmhero/p/1788881.html
Copyright © 2011-2022 走看看