Results 1 to 5 of 5

Thread: Switch Content script II - content always open instead of closed on page load

  1. #1
    Join Date
    Jan 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cool Switch Content script II - content always open instead of closed on page load

    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

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    See this demo.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jan 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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?

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Looks like you have it working now. BTW, on your HTML page, do the script call like so (retaining the credit):

    Code:
    <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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Jan 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Thank you

    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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •