View Full Version : Open default

01-16-2007, 02:17 PM
1) Script Title: Switch Content

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

3) Describe problem:
I have a load of content being generated dynamically via a database.
Everything about the script and the functionalitys work fine /Except/ trying to get the default open state to work.

I tried to have it work out dynamically but that didn't work so have resorted for the time being to statically specifying it e.g.


Any assistance much appreciated!

01-16-2007, 08:51 PM
You should never have to explicitly get a content to expand (ie: by adding style="display:block"). Remove that first.

The defaultExpand() function does work on your page- I just tested it locally. However, since you also have the persistence feature enabled:


The above will take over right after the first time the page is loaded (ie: reload the page) over any specified default expanded content:


To truly test if the defaultExpanded feature is working, remove the setPersist() line first to see how the script behaves without persistence overriding things.

01-16-2007, 10:56 PM
thanks, you were right on the money with the persistence. Soon as I commented it out then the default worked.