zoukankan      html  css  js  c++  java
  • 我三秒后要隐藏

    <!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" lang="gb2312">
    <head>
    <title> New Document </title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <meta name="robots" content="all" />
    <meta name="author" content="ZerGiNe" />
    <meta name="Copyright" content="All rights reserved by ZerGiNe" />
    <meta name="description" content="desc" />
    <meta name="keywords" content="desc" />
    <link rel="icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" rev="stylesheet" href="" type="text/css" media="all" />
    </head>
    <body>
    <div id="hidden_div" >3 秒 </div>
    </body>
    </html>
    <script>
    var action;
    var obj;
    var timer;
    function setTimer(id,time,act){
    obj
    = document.getElementById(id);
    action
    = act;
    timer
    = time;
    setTimeout(
    "doFunc(action,obj)",timer);
    }
    function doFunc(action,obj){
    var _eventObj = obj;
    switch (action){
    case "hidden":
    _eventObj.style.display
    ='none';
    break;
    case "show":
    _eventObj.style.display
    ='';
    break;
    default:
    _eventObj.style.display
    ='';
    break;
    }
    }
    var timeComp = new setTimer("hidden_div",3000,"hidden")
    </script>
    <script>
    var action;
    var obj;
    var timer;
    function setTimer(id,time,act){
    obj
    = document.getElementById(id);
    action
    = act;
    timer
    = time;
    setTimeout(
    "doFunc(action,obj)",timer);
    }
    function doFunc(action,obj){
    var _eventObj = obj;
    switch (action){
    case "hidden":
    _eventObj.style.display
    ='none';
    break;
    case "show":
    _eventObj.style.display
    ='';
    break;
    default:
    _eventObj.style.display
    ='';
    break;
    }
    }
    var timeComp = new setTimer("hidden_div",3000,"hidden")
    </script>
    <body onload="setTimer('a1',3000,'hidden');setTimer('a2',4000,'show')">
    <div id="a1">等3秒。。。载入中</div>
    <div id="a2" style="display: none">完成</div>
    </body>
    <script> 
    var _st = window.setTimeout;
    window.setTimeout
    = function(fRef, mDelay) {
    if(typeof fRef == 'function'){
    var argu = Array.prototype.slice.call(arguments,2);
    var f = (function(){ fRef.apply(null, argu); });
    return _st(f, mDelay);
    }
    return _st(fRef,mDelay);
    }
    function func(id,dis){
    document.getElementById(id).style.display
    =dis;
    }
    </script>
    <body onload="setTimeout(func,3000,'a1','none');setTimeout(func,4000,'a2','');">
    <div id="a1">等3秒。。。载入中</div>
    <div id="a2" style="display: none">完成</div>
    </body>
    <script> 
    function show(id,bshow,delay){
    setTimeout(
    function(){
    document.getElementById(id).style.display
    =bshow?'':'none';
    },delay);
    }
    </script>
    <body onload="show('a1',false,300);show('a2',true,400)">
    <div id="a1">等3秒。。。载入中</div>
    <div id="a2" style="display: none">完成</div>
    </body>
          <body onload="setTimeout('a1.style.display=\'none\'',3000);setTimeout('a2.style.display=\'\'',4000);">
    <div id="a1">Loading.......</div>
    <div id="a2" style="display: none">Complete !</div>
    </body>






    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    </head>
    <body>
    <div id="a1" onClick="setTimeout('a1.style.display=\'none\'',3000)">我三秒后要隐藏</div>

    </body>
    </html>
    <div id="a1">我三秒后要隐藏</div>
    <button onclick="hide()">点我</button>
    <script>
    function hide(){
    setTimeout(
    "a1.style.display='none'",3000);
    }
    </script>


    编辑器加载中...

  • 相关阅读:
    Oc中UIKit框架的继承结构
    iOS中的事件传递和响应者链
    音频视频,音乐,录音参考资料
    对象序列化(对对象的归档NSKeyedArchiver、接档NSKeyedUnarchiver)的理解
    iOS--UI篇——UIToolbar的简单使用
    iOS--内购的使用方法
    协调-分布式锁
    协调-协调架构原理
    协调-分布式配置
    队列-生产者消费者模式
  • 原文地址:https://www.cnblogs.com/94YY/p/2390509.html
Copyright © 2011-2022 走看看