PDA

View Full Version : Switch Content script II - content always open instead of closed on page load



matthains
01-19-2006, 03:22 PM
Hi there

Switch Content script II

Everytime my page opens the script for the first time, the content is all visible. I want it to be contracted from the first time it loads.

Does anyone else have this problem?

The page is here : http://www.hainsclan.com/stuff.htm

Thanks

Matt

jscheuer1
01-19-2006, 09:30 PM
See this demo (http://home.comcast.net/~jscheuer1/side/switch_II_closed_persist.htm).

matthains
01-23-2006, 10:11 AM
Hi there, thanks for the reply. However, my script is the same script. The only difference is that I cut the script, put it into a .JS file and reference it from there. Could that be the reason?

jscheuer1
01-23-2006, 12:37 PM
Looks like you have it working now. BTW, on your HTML page, do the script call like so (retaining the credit):


<SCRIPT TYPE="text/javascript" SRC="scripts/switchcontents2.js">
/***********************************************
* Switch Content script- Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use. Last updated April 2nd, 2005.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
</SCRIPT>

This is as per DD's usage terms.

matthains
01-27-2006, 11:51 AM
Yeah, I had to change to the other Switch Content script but kept the DIV tags and stuff from the new one, so a few tweaks were needed but not too many. I realised the Switch Content script II is supposed to be expanded by default! I did keep the copyright stuff in the linked file, but I will add it there on the main page too.

Thanks again.

Matt