在特定时间后隐藏'div' [英] Hide 'div' after specific amount of time
本文介绍了在特定时间后隐藏'div'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个div,它通常用于显示一些状态消息,例如你选择了一些xyz的东西
I have a div, which is generally used for showing some status messsage like "you have selected some xyz thing"
现在,我需要间隔隐藏它页面加载后的特定时间量(比如60秒)。
Now, I need to hide it at interval of specific amount of time (say, 60 secs) after page loads.
代码:
<div id="msg">You have selected 'Time and Money' magazine</div>
如何执行上述操作?
谢谢
推荐答案
$(document).ready(function () {
setTimeout(function () {
$('#msg').hide();
}, 60000);
});
这篇关于在特定时间后隐藏'div'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文