View Full Version : Contractible Headers Script

04-05-2005, 10:27 AM
hey, how can i make it so that the Contractible Headers Script divs are open by default, and still use the memorise which ones are open fuinction

i added an onload function to the body and they opened the first time, but they were reversed on reload after closing some cus of the memory function,

now ive turned off memory and im using an onload, but theres lots of scripts that do that so its a bit pointless.

any help please?

04-05-2005, 07:04 PM

Just add "display: block" into each of the Header DIVs. This is explaied near the bottom of the script page:

One final thought. When the page first loads, by default all of the participating content are contracted until the user starts clicking on the headers. If you wish to make a particular content be visible from the start, you can use the CSS "display" property to accomplish this:

<div id="sc1" class="switchcontent" style="display:block">

04-05-2005, 08:16 PM
thanks alot, sorry i missed that

04-05-2005, 08:28 PM
im still haveing problems, it wont work.
heres my page (http://gfxproject.com/dont-remove-me/divs.htm)

and heresthe dd script (http://dynamicdrive.com/dynamicindex1/navigate2.htm)
can anyone help me?


04-05-2005, 08:58 PM
Hmmm strange. Ok, try using Switch Content script instead (http://dynamicdrive.com/dynamicindex17/switchcontent.htm). The two scripts basically are the same as far as functionality (and even source code), so if that works, then I'll be updating Contractible Headers script with the same base code.

04-05-2005, 09:11 PM
ill give it a try, just a sec

04-05-2005, 09:20 PM
it doesnt work either for me...

it could well be a prob on my side, the js spoono.com menu doesnt work for my pc even tho i got the most recent firefox and ie


does it work for you?

04-05-2005, 09:45 PM
Well, you inserted style="display:block" in the wrong tag. It shouldn't go in the headers (<h3>), but the DIV that it actually contracting/ expanding:

<div id="sc3" class="switchcontent" style="display: block">
DHTML is the embodiment of a combination of technologies- JavaScript, CSS, and HTML. Through them a new level of interactivity is possible for the end user experience.

04-05-2005, 09:52 PM
ouch sorry bout that

thanks for the help anyway


i didnt do that in the first page tho

04-05-2005, 10:02 PM
Does it work now for you? When testing, be sure to close your browser and restart it first, to clear the persistence.

04-05-2005, 10:27 PM
the second one now works perfectly. i havent uploaded it tho.

the first one doesnt