怎么可能在用户注册后5秒隐藏一个div?这里使用的是用户注册的php时间戳。我确信这可以使用jquery来完成,但不是很确定。
我在网上得到了这个脚本,它只在5秒内工作良好,但它仍然在页面加载后显示,并在5秒后停止。
<script type="text/javascript">
setTimeout(function() {
$('#ghdiv').fadeOut('fast');
}, 5000); // <-- time in milliseconds
</script>
<div id="ghdiv">Hide after 5 seconds</div>我需要它只显示一次,5秒后,用户注册
发布于 2017-02-27 17:55:15
$(function(){
setTimeout(function() {
$('#ghdiv').fadeOut('fast');
}, 5000); // <-- time in milliseconds
});<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="ghdiv">Hide after 5 seconds</div>
发布于 2017-02-27 17:53:52
像这样试试看
<script type="text/javascript">
setTimeout(function() {
$('#ghdiv').fadeOut('fast');
}, 5000); // <-- time in milliseconds
</script>
<div id="ghdiv">Hide after 5 seconds</div>https://stackoverflow.com/questions/42482523
复制相似问题