You can use plain javascript, this will call your_func once, after 5 seconds:(您可以使用普通的javascript,这将在5秒后调用一次your_func:)
setTimeout(function() { your_func(); }, 5000);
If your function has no parameters and no explicit receiver you can call directly setTimeout(func, 5000)
(如果您的函数没有参数且没有显式接收器,则可以直接调用setTimeout(func, 5000)
)
There is also a plugin I've used once.(我曾经用过一个插件。) It has oneTime
and everyTime
methods.(它具有oneTime
和everyTime
方法。)
jQuery timers plugin(jQuery计时器插件)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…