E 'possibile, utilizzando jQuery, attivare un evento per impostare il testo di un tag div dopo n. secondi?jQuery Timed Event
Grazie! George
E 'possibile, utilizzando jQuery, attivare un evento per impostare il testo di un tag div dopo n. secondi?jQuery Timed Event
Grazie! George
var doIt = function() {
$("div.my").text("My message");
}
setTimeout(doIt, 3000);
se si sta utilizzando jQuery 1.4, si può sempre fare:
$(function() {
$('#divId').delay(3000).text('New Text');
});
Sto usando il plugin seguenti jQuery sotto per questo. Il ritardo può essere utilizzato con le funzioni concatenate, non è possibile.
Ritardo
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 Credo che il ritardo plug-yo hai menzionato in realtà ora parte della libreria jQuery principale, come da mia risposta. –