2010-02-05 20 views

Respuesta

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

si estás usando jQuery 1.4, siempre se puede hacer:

 
$(function() { 
    $('#divId').delay(3000).text('New Text'); 
});

4

He estado usando los siguientes plugins jQuery por debajo de este. El retraso se puede usar con funciones encadenadas, ahora no.

retardo

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

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

notNow

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

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

+1 creo que el plug-in de retardo años Usted mencionó que ahora es parte de la biblioteca principal de jQuery, según mi respuesta. –