js定时器控制图片隐藏

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
</head>
<body>
<div id="loading" style="margin:0 auto;">
<div class="img"> <img src="loading.gif" alt="加载中...">
<p>加载中...</p>
</div>
</div>
<script>
var oloading=document.getElementById('loading');
setTimeout(function(){
oloading.style.display='none';
},500);
</script>
</body>
</html>

 

posted @ 2019-06-27 11:16  绿林豪士  阅读(658)  评论(0编辑  收藏  举报