Problem with unordered list and slideToggle
I am making a post-comment page and I am facing a problem in making the comments unordered list slideToggle
my code-
$开发者_JAVA技巧("#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");
}
});
});
Maybe try
$('.'+pid).append(html);
instead of
$("#"+pid).append(html);
精彩评论