View Full Version : Switch Content script II

09-28-2007, 06:46 PM
1) Script Title: Switch Content Script II (icon based)

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

3) Describe problem: I can not get the Persist to work. Everything else works fine except this feature. How do I get it to remember which section is expanded? Here's settings and initialization part of the script...

<script type="text/javascript">
var section=new switchcontent("switchgroup1", "div")
section.setStatus('<img src="../../media/hide.gif" /> ', '<img src="../../media/show.gif" /> ')
section.setPersist(true, 365)

09-28-2007, 10:15 PM
Do you have multiple switch content instances on the same page? If so, remember that the variable "section" cannot be repeated, and must be unique for each instance. Other than that, it should work...