View Full Version : Animatedcollapse.toggle on multiple div's

12-17-2011, 01:53 PM
1) Script Title: Javascript: Animatedcollapse.toggle

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/animatedcollapse.htm

3) Describe problem: If you see on this page: www.arcan3.co.uk/blog , I have the collapse function embedded so that only one post shows at one time etc. I want to add Facebook comments into each post, which i know how to do. However, instead of them being in the post, I would like them to be just under it on the black background. I also know where to put the coding for this to happen. Though i do not want each comments bar for each post showing at the same time, only the one for the post which is currently open. So I am stuck on the coding of the animatedcollapse.toggle. Here is what it currently looks like:

echo '<a href="#" rel="toggle[post'.$row['ID'].']" data-openimage="'.$urlpattern.'/images/collapse.png" data-closedimage="'.$urlpattern.'/images/expand.png"><img src="images/collapse.png" style="border-width:0" /></a> ';
echo '<a href="javascript:animatedcollapse.toggle(\'post'.$row['ID'].'\')" title="Expand/Collapse">';
echo $row['Title'];
echo '</a>';

where post'.$row['ID'].' is the text within a post.

I assume I have to another <div id=" "> and put the comments inside this. And then put this new ID in the script. But I cant seem to work out how to do that.

Any ideas?? Cheers :)