我正在使用jQuery版本:2.2.4
我想知道是否可以将 document.ready
执行延迟一段时间或任何特定时间。我知道在 document.ready
之后我们可以使用 setTimeout
函数。但我想知道有什么更好的方法来做到这一点。
任何引用都会非常有帮助。
提前致谢。
最佳答案
是的,与 jQuery.holdReady
:
Description: Holds or releases the execution of jQuery's
ready
event.
// Start holding
jQuery.holdReady(true);
// ...later, when you want to stop holding (perhaps after a timer delay)...
jQuery.holdReady(false);
关于jquery - 是否可以暂停或延迟 document.ready 执行一段时间?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43370058/