3秒钟触发你的事件

2008-12-30 17:00:09 by 【6yang】, 46 visits, 收藏 | 返回

<html>
<head>
<script>

var cnt = 0;
function sett()
{
 if(cnt < 1) {
  document.getElementById("aaa").style.display="block";
  cnt = cnt + 1;
 }
}

function init() {
 setTimeout("sett()",3000);
}
</script>
</head>
<body onLoad="init()">
<div id="aaa" style="display:none">
fdsfdssdf
</div>

</body>
</html>


 

<html>
<head>
<script>

var cnt = 0;
window.onload=function(){setTimeout("sett()",3000);}
function sett()
{document.getElementById("aaa").style.display="block"; }


</script>
</head>
<body>
<div id="aaa" style="display:none">
fdsfdssdf
</div>

</body>
</html>


<html>
<head>
<style type="text/css">
 .dis_none{ display:none;}
 .dis{ display:block;}
</style>
<script>
window.onload=function(){
if(document.getElementById("demo_display").className=="dis_none")
{setTimeout("sett()",1000);
alert(document.getElementById("demo_display").className);}
}
function sett()
{document.getElementById("demo_display").className="dis"; }
</script>
</head>
<body>
<div id="demo_display"  class="dis_none">
fdsfdssdf
</div>

</body>
</html>

分享到:
share

    图片原图

    loading

    loading