View Full Version : animated collapsible div - database driven - persistence problem

09-10-2012, 09:46 PM
1) Script Title: animated collapsible div

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

3) Describe problem: I've set up a page with the animated collapsible divs, and now the script and page content is pulled from a database. Here's the page:


Other pages for testing persistence: http://powelltatedev.com/checklist/test.asp?projectID=2 | http://powelltatedev.com/checklist/test.asp?projectID=3

If you toggle between the three pages (see nav at the top), the divs don't persist... for some reason panel two is the one that each page seems to like... keep seeing that one open, instead of the one you had previously opened before leaving the page. If you view source, all looks good. The javascript is db driven, as are the div names, and links to open/collapse the divs.

Any ideas as to why the persistence isn't working, why panel two is the panel the code really seems to like for some reason? In nutshell, will have a number of different projects, each using this same page... the projectID is how the collapsible div javascript is made unique (appending the id)... ditto for the divs and links.

THANKS FOR ANY IDEAS!!! I'm totally stumped on this one.

09-18-2012, 06:32 AM
On Page 2 and Page 3, inside the initialization code for the script, you've specified "attr2" and "attr3" as the group name, respectively. It should be "attr1" instead, to be consistent with that for Page 1. For example:

animatedcollapse.addDiv('style2', 'fade=1,height=auto,group=attr2,persist=1')
animatedcollapse.addDiv('standards2', 'fade=1,height=auto,group=attr2')
animatedcollapse.addDiv('seo2', 'fade=1,height=auto,group=attr2')