View Full Version : Why wont work the collpsible script

10-30-2008, 11:43 PM
It is my problem:

1. I'm getting data from database with ajax.
2. Returnig this data with xml.responseText to div, fine,
3. My data is stored in div's structure.

<div><a href="javascritpt:animatedcollapse.toggle('m1')">collspse</a> Title</div>
<div id="m1" style="style:display:none">data</div>
<div><a href="javascritpt:animatedcollapse.toggle('m2')">collspse</a> Title</div>
<div id="m2" style="style:display:none">data</div>


Im using the Animated Collapsible DIV v2.01 from this page: http://www.dynamicdrive.com/dynamicindex17/animatedcollapse.htm

When I'm usin it with hard write code without ajax it is okey. But when I want dinamically create the code with php and import via ajax to the view page it isn't work.

What can by the solution this problem?

javascripts links (to jquery-1.2.2.pack.js and animatedcollapse.js) I store in the page with ajax.
the script I generate like this:

<script type="text/javascript">
$query=db_query("SELECT id FROM {table}");
while ($id=db_fetch_array($query)) echo "animatedcollapse.addDiv('m".$id['id']."','fade=1')\n";

and it looks good...

any suggestions? thx for help.

10-31-2008, 05:34 AM
There are a couple of threads on this, for example: http://www.dynamicdrive.com/forums/showthread.php?p=161312

10-31-2008, 04:18 PM
It is working now. thx (i coundn't find that post). really thx.