2010-02-05 4 views
16

jQuery를 사용하여 n 이후에 div 태그의 텍스트를 설정하는 이벤트를 실행할 수 있습니까? 초?jQuery Timed 이벤트

감사합니다. 당신이 jQuery를 1.4을 사용하는 경우 조지

답변

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

, 당신은 항상 할 수있다 :이 아래 다음의 jQuery 플러그인을 사용하고

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

4

. 체인 기능과 함께 지연 기능을 사용할 수는 없습니다.

지연

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

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

+1 내가 지연 요 플러그인 있다고 생각 notNow

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

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

u는 실제로 내 대답에 따라 주요 jQuery 라이브러리의 일부입니다. –