Similar to what Facebook does on its newsfeed, I want to allow commenting on numerous feed items, which I'm pulling via a php foreach statement. This is creating identical classes. So when I click .show_comments it activates everything.
I went through SO and found something akin to what you see below...but it's not working for me.
How do I target individual .show_comments to animate and toggle the selected item?
$j(function() {
$j(this).find('.show_comments').click(function(){
$j(this).find('.comments').slideDown("fast");
$j(this).find(".answer_comments").toggle();
});
$j(this).find('.hide_comments').click(function(){
$j(this).find('.comments').slideUp("fast");
$j(this).find(".answer_comments").toggle();
});
});