2010-12-13 8 views
1

내가 "링크"를 누르면, 제출 버튼이있는 텍스트 필드 (toggle())가 나타납니다. 당신이 그것을 제출하면, 내 아약스 성공에 내가 가진 : 당신이 다시 수행하려는 경우jQuery : hide and show

$('#RespondMsg' + id).hide(); 
$("#response" + id).fadeOut('slow'); 

것은 이제 "링크", 남아있다. 그러나 내가 이것을 가지고 있기 때문에 hide()fadeOut() 필드는 다시 나타나지 않을 것입니다. 어떻게 해결할 수 있습니까?

나는 시간 제한

setTimeout(function(){ 
    $('#RespondMsg' + id).show(); 
}, 1000); 

과 노력하지만 그래 그건 그냥 일초 후 다시 필드를 보여줍니다.

그래서 나는 그것이 성공을 숨기려하고 당신이 "링크"를 누르면,이 내 "링크"보이는 방법 (#respondmsg, #response)

다시 필드를 표시해야합니다 같은 :

$('.reply').live('click', function() { 
    $('#replyWall'+$(this).attr('data-id')).toggle(); 
    document.getElementById('replyMsg'+$(this).attr('data-id')).focus(); 
}); 

답변

1
$('.reply').live('click', function() { 
     var id = $(this).attr('data-id'); 
     $('#replyWall'+id).toggle(); 
     $('#RespondMsg' + id).hide(); 
     $("#response" + id).show(); 
     $('replyMsg'+id).focus(); 
}); 
+0

을 didnt는 .. – Karem

+0

을 해결 어떻게 그렇게? 자바 스크립트 오류? 당신이 보여주고 싶은 요소를 보여주지 않습니까? –

+0

지금 내가 .reply 요소를 보지 않을 때 (RespondMsg) – Karem