jQuery定时事件

是否有可能使用jQuery触发事件以在n之后设置div标签的文本。 秒?

谢谢! 乔治

var doIt = function() { $("div.my").text("My message"); } setTimeout(doIt, 3000); 

如果您使用的是jQuery 1.4,您可以随时执行:

 $(function(){
    $('#divId')。延迟(3000).text('新文本');
 }); 

我一直在使用下面的jQuery插件。 延迟可以与链接函数一起使用,而现在不能。

延迟

http://plugins.jquery.com/project/delay

 $('#animate-this').fadeIn().delay(500).fadeOut(); 

现在不要

http://plugins.jquery.com/project/notNow

 $.notNow(2000, function() { alert('woolsworth'); });