Results 1 to 3 of 3

Thread: expanding/detracting in switch content script

  1. #1
    Join Date
    Jul 2005
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default expanding/detracting in switch content script

    1) Script Title: Switch content script

    2) Script URL (on DD): http://dynamicdrive.com/dynamicindex...tchcontent.htm

    When i click on one item, it expands, and remains expanded when i click the next item, and so on a so forth. How can i get the first item to detract when i click the next item i want expanded?

    for example, when i click the first question on there "What is JavaScript?", it expands
    then im done reading it, and want to see the next question, so i click on the next question "Difference betwen Java & JavaScript?", and it expands, but when this expands, i want the previous one to detract.

    thanks, all help greatly appreciated!!
    lakp

  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

    From Step 1 on the Demo Page:

    <script type="text/javascript">

    /***********************************************
    * 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
    ***********************************************/

    var enablepersist="on" //Enable saving state of content structure using session cookies? (on/off)
    var collapseprevious="no" //Collapse previously open content when opening present? (yes/no)

    var contractsymbol='- ' //HTML for contract symbol. For image, use: <img src="whatever.gif">
    var expandsymbol='+ ' //HTML for expand symbol.
    Set the highlighted variable to yes:

    Code:
    var collapseprevious="yes" //Collapse previously open content when opening present? (yes/no)
    - John
    ________________________

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

  3. #3
    Join Date
    Jul 2005
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    OH CRAP!!! i dont believe i didnt see that!@#$ sorry man, that was idiotic ...

    thanks!
    wow ... i feel depressed

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
  •