Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7727965
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T05:35:51+00:00 2026-06-01T05:35:51+00:00

First off, i’m a front end designer/developer with very very minimal javascript and PHP

  • 0

First off, i’m a front end designer/developer with very very minimal javascript and PHP knowledge.

I’m using the ‘Switch Content Script’ which I found on Dynamic Drive – http://www.dynamicdrive.com/dynamicindex17/switchcontent.htm

This is how i’ve incorporated it in to the site i’m developing for a friend http://www.davidatkinson.com/ss-testarea

My question is, with that Switch Content Script, is it possible to modify it to have one of the content DIVS display automatically when visiting the site?

In the source code you’ll see that I managed a botch job (I know, I can see you cringing now) using jQuery toggle script. I’ve commented out the HTML as it was conflicting with the PHP contact form i’m using. When you click the send button, the page refreshes, and by doing so it was displaying panel I was loading by default.
So for now, i’ve decided to pass on using the jQuery botch job, in the hope someone may be able to help me with modifying the Switch Content Script.

I was thinking of just using the jQuery toggle script (as i’ve done here) instead of the Switch Content Script, but I figure i’m going to come across the same stumbling blocks?

If anyone can help, the whole site can be downloaded here

Thanks in advance 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T05:35:52+00:00Added an answer on June 1, 2026 at 5:35 am

    EDIT: Adding switchcontent.prototype.defaultExpanded(0) after line 19 in index.php, or just before your jquery starts will open the first one, simply change the 0 to any number to open whicher content box you wish to 😉

    If you read the documentation for that switch content script you can see that they have a function for auto expanding an instance on load.

    instance.defaultExpanded(indices)
    

    this is from the doc:

    By default, the script will contract all contents within a switch
    group when the page first loads. Use this method to specify those
    contents that should be expanded by default, by entering their index
    (position) relative to the other contents inside the group, each
    separated by a comma (,). Parameter: Indices of the contents to be
    expanded by default relative to the rest of the contents (starts at
    0). A few examples:

    instance.defaultExpanded(0) //1st content expanded
    instance.defaultExpanded(0,1) //1st and 2nd content expanded
    instance.defaultExpanded(3,5) //3rd and 5th content expanded

    Exceptions: Two conditions if met will override this setting:

    If setPersist() is enabled, the persisted states takes precedence. If
    collapsePrevious() is enabled, then only the first content set to
    expand by default will be expanded, as collapsePrevious() means only
    one content can be open at any given time.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First off: I'm using a rather obscure implementation of javascript embedded as a scripting
First off, i'd like to say that my programming knowledge is very basic and
First off, let me clarify the platforms we are using. We have an ASP.NET
First off, let me define the end goal: I'd like to Wordpress (version 2.8)
First off, I'm not terribly experienced in XML. I know the very basics of
First off, a lil about me, i'm very new to GUI programming, especially with
First off, I am using Windows XP. I have multiple hard drives and it
First off, let me start off that I am not a .net developer. The
First off, I'm using Access 2000 and DAO. I have code that executes a
First off, I'm using an older version of Restlet (1.1). Secondly, I'm not sure

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.