View Full Version : Animated collapse

03-13-2009, 03:17 PM
1) Script title: Animated Collapse div v2.2
2) Url: http://www.dynamicdrive.com/dynamicindex17/animatedcollapse.htm

3) Describe problem: Hy, I have a problem setting up this code. I want to put cookies into it, so when the panel is collapsed to remain that way when I refresh the page
One more thing, when I the div is expand to have a picture, and when is colapsed another picture. I've looked @ here, but nothing that could help me. Thanks in advance

03-13-2009, 06:40 PM
Please read the documentation. Both of your questions should be answered in it already. For persistence, just define the attribute "persist=1" when calling addDiv(), while for the second part, the ontoggle() event (http://www.dynamicdrive.com/dynamicindex17/animatedcollapse_suppliment.htm) should do what you need for it.

03-15-2009, 04:01 AM
Well thanks for the second problem and for you're answer in sort time. But i don't get it. I have this:

<script type="text/javascript">

animatedcollapse.addDiv('news', 'fade=1,speed=500,persist=1')
animatedcollapse.addDiv('polls', 'fade=1,speed=500,persist=1')
animatedcollapse.addDiv('stats', 'fade=1,speed=500,persist=1')
animatedcollapse.addDiv('active', 'fade=1,speed=500,persist=1')
animatedcollapse.addDiv('sb', 'fade=1,speed=500,persist=1')


Those divs do not persist when I refresh page. Any ideea ? Tell me please how to make it for example I have this:

<h2><a href="javascript:animatedcollapse.toggle('active');putCookie('active');">Active users <img src=pic/hide.gif title=Show/Hide alt=Show/Hide border=0></a></h2>
<div id="active">
<table class=main width="767" border=0 cellspacing=0 cellpadding=0><tr><td class=embedded>

<table width="100%" border=1 cellspacing=0 cellpadding=10><tr><td class=text>

<br />
Welcome to our newest member, <b><?=$latestuser?></b>! <br />
Most users online was: <strong><?=$rec[users]?></strong> on <strong><?=$rec[date]?></strong> <br />

Most ever visited in 24 hours was <strong><?=$totalonline24?></strong> <br />

<hr />
<strong>Active users(<?=$totalonline?>):</strong> <?=$activeusers?>

<? ?>

it doesn't work when I refresh page

03-15-2009, 04:46 AM
It should work (confirmed this using the default demo on the script page), though without seeing the fully rendered HTML of your page, it's hard to say why it doesn't. Please post a link to the page on your site that contains the problematic script so we can check it out.

03-15-2009, 01:27 PM
here is the link: http://rds-zone.ro
here is an account to log in and see:
Username: Test
password: test

Animated collapse function is on the first page (Home)