2011-07-23 54 views
0

我作出了評論後頁,我在作出評論無序列表面臨的一個問題的slideToggle問題與無序列表和的slideToggle

我的代碼 -

$("#ccoomm").click(function() { 

var pid = $(this).attr("class"); 
var text = $(".comment" + pid).val(); 
var email = $("#hidden").val(); 
var data = "pid=" + pid + "&text=" + text + "&email=" + email; 
$("#flash").show(); 
$("#flash").fadeIn(500).html('<img src="wamp.gif" /> Loading...'); 
$.ajax({ 
    type: "POST", 
    url: "comments.php", 
    data: data, 
    cache: false, 
    success: function(html) { 
     $("#"+pid).append(html); 
     $("#flash").fadeOut(100); 
     $("#text").val(""); 
     $(".comments"+pid).slideToggle(100); 
     $(this).toggleClass("active"); 
    } 
}); 

});

+2

exactlt您有什麼問題?你能還發布您的html代碼是什麼? –

回答

0

也許嘗試的

$('.'+pid).append(html); 

代替

$("#"+pid).append(html);