View Full Version : Does expand/collapse script like this exist?

01-24-2006, 07:43 PM

I have a definition list:

<dt><a>switch link</a></dt>
<dd>bla bla</dd>

I want to have a link in the <dt> that expands/collapses the <dd>. Is it possible to have a script that doesn't require an id or a class in <dd>? And also to put a css background image in <dt> (or <dl>) which is changed on every click (a +/- sign)? And to be able to remember it's state (expanded or collapsed) next time the page is visited (with cookies?)

Do you know if a suitable script exists?

Thank you very much,

01-26-2006, 05:20 AM
That's invalid markup, as far as I can tell, so it is unclear what you have in mind. Have you looked at the expandable content and switch content scripts here at DD?

01-26-2006, 05:38 PM
.... </dl>

I just asked if you have seen expand/collapse script that can remember it's state. I mean whether it is collapsed or expanded. Like gmail for expample. If you expand the "labels" box there, next time you visit gmail it will be expanded again. Or the opposite.

01-26-2006, 05:43 PM

01-26-2006, 06:05 PM
Erm... it's not a DD script. He was asking if one existed, not asking for help with an existing one.
neomatrix: Try this (http://www.dynamicdrive.com/dynamicindex17/switchcontent.htm).