17

jQueryを使用して、nの後にdivタグのテキストを設定するイベントを発生させることは可能ですか? 秒?

ありがとう!ジョージ

4

3 に答える 3

28
var doIt = function() {
    $("div.my").text("My message");
}
setTimeout(doIt, 3000);
于 2010-02-05T16:31:07.657 に答える
15

jQuery 1.4を使用している場合は、いつでも次のことができます。

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

于 2010-02-05T16:32:05.313 に答える
4

これには、以下の jQuery プラグインを使用しています。Delay はチェーン関数で使用できますが、notNow では使用できません。

遅れ

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

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

今はやめろ

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

$.notNow(2000, function() { 
    alert('woolsworth');
});
于 2010-02-05T16:39:57.290 に答える