gpt4 book ai didi

javascript - 需要 Javascript 延迟

转载 作者:行者123 更新时间:2023-11-29 22:30:48 25 4
gpt4 key购买 nike

我想知道如何修改这段代码,使其在函数激活之前有 2 秒的延迟:

<script type="text/javascript">
function iframe_onload()
{
var theWaitCell = document.getElementById('Wait1');
theWaitCell.style.display = "none";
}
</script>

如有任何帮助,我们将不胜感激

谢谢!

最佳答案

function iframe_onload()
{
var timer = setTimeout(function() {
var theWaitCell = document.getElementById('Wait1');
theWaitCell.style.display = "none";
}, 2000);
}

关于javascript - 需要 Javascript 延迟,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7016561/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com