PDA

View Full Version : Switch Content Script CLOSE



sherman
11-29-2007, 11:10 PM
1) Script Title: Switch Content Script

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

3) Describe problem:

Im not sure how to make the Demo 2 script stay in the closed state on opening the browser? It works in Firefox but not in Safari?

What values do I need to pass inorder to keep my div closed on load?

Here is what I have:



<script type="text/javascript">
var joeexample=new switchcontent("switchgroup", "") //Limit scanning of switch contents to just "p" elements
joeexample.setStatus('<img src="../images/icon-hide.gif" alt="[hide]" />', '<img src="../images/icon-show.gif" alt="[show]" />')
joeexample.setColor('', '')
joeexample.collapsePrevious(false) //Allow more than 1 content to be open simultanously
joeexample.setPersist(false)
joeexample.defaultExpanded(0,1)
joeexample.init()
</script>

ddadmin
11-30-2007, 04:48 AM
Have you tried removing the line:


joeexample.defaultExpanded(0,1)

The above causes the 1st and 2nd content to be expanded by default.

sherman
11-30-2007, 05:01 PM
That seemed to work!

Thanks :)