Reputation: 14511
I am using jQuery slideToggle to show/hide comments. I need my function to always make sure the DIV is open after a comment post. How do I do this?
$.ajax({
type: "POST",
data: "trackid="+trackid,
url: "http://rt.jaxna.com/viewcomments.php",
success: function(data)
{
// alert(data);
$(".userError").append(data);
}
});
$(parent).slideToggle();
$(parentNew).slideToggle();
Upvotes: 0
Views: 3111
Reputation: 77956
add
if($('#my_div').is(':hidden'))
{
$('#my_div').slideDown();
}
Upvotes: 4