如何在一段时间后隐藏div? [英] How to hide a div after some time period?
本文介绍了如何在一段时间后隐藏div?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要隐藏 div
(例如Gmail中的邮件发送成功),在我重新加载页面一段时间之后。
I need to hide a div
(like "mail sent successful" in Gmail) after a certain time period when I reload the page.
我该怎么做?
How can I do that?
推荐答案
这是一个基于测试的完整工作示例。比较它与你目前弄清楚你错在哪里。
Here's a complete working example based on your testing. Compare it to what you have currently to figure out where you are going wrong.
<html>
<head>
<title>Untitled Document</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
$(document).ready( function() {
$('#deletesuccess').delay(1000).fadeOut();
});
</script>
</head>
<body>
<div id=deletesuccess > hiiiiiiiiiii </div>
</body>
</html>
这篇关于如何在一段时间后隐藏div?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文