javascript定时关闭的层

javascript定时关闭的层


<!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">
<head>
<title>定时关闭的层</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<style>
#divbox{
border:2px solid #0066cc;
background:skyblue;
padding:20px;
font-size:22px;
color:white;
width:100px;
height:30px;
margin-top:100px;
margin-left:auto;
margin-right:auto;
}
</style>
<script language="javascript">
function codefans(){
var box=document.getElementById("divbox");
box.style.display="none";
}
setTimeout("codefans()",2000);//3秒
</script>
</head>
<body>
<div id="divbox"> 保存成功</div>
</body>
</html>

如果您觉得我的文章有帮助,请随意赞赏!

*发表评论

用QQ账号登录  请登录后发表评论