使用JavaScript在特定延迟后执行脚本 [英] Execute script after specific delay using JavaScript
本文介绍了使用JavaScript在特定延迟后执行脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否存在类似于jQuery delay()
或 wait()
的JavaScript方法(以延迟执行一段特定时间的脚本)?
Is there any JavaScript method similar to the jQuery delay()
or wait()
(to delay the execution of a script for a specific amount of time)?
推荐答案
有以下内容:
setTimeout(function, milliseconds);
函数可以在执行函数之前传递。
function which can be passed the time after which the function will be executed.
请参阅: Window setTimeout()
方法。
See: Window setTimeout()
Method.
这篇关于使用JavaScript在特定延迟后执行脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文