Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: How do i load a page with a particular accordian section open as a default?

  1. #1
    Join Date
    Mar 2007
    Posts
    9
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default How do i load a page with a particular accordian section open as a default?

    1) Script Title: ddaccordion

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...daccordion.htm

    3) Describe problem:

    if I click on a link in one particular block that goes to another page in that same block, it will not keep that block open on page load, but instead it will open up the last one i was in. How do i designate which block to have open by default on each page?

    for instance,

    on pages 1-4 i want block 1 to open by default. for pages 2-8 i want block 2 to be open by default.

    any help would be great.

  2. #2
    Join Date
    Aug 2004
    Posts
    9,876
    Thanks
    3
    Thanked 962 Times in 951 Posts
    Blog Entries
    15

    Default

    The parameter:

    Code:
    defaultexpanded: [], //index of content(s) open by default [index1, index2, etc]. [] denotes no content.
    within the initialization code in the HEAD dicates which headers should be expanded by default. So on the 1st-4th page, you'd have:

    Code:
    defaultexpanded: [0], //index of content(s) open by default [index1, index2, etc]. [] denotes no content.
    while the others, something like:
    Code:
    defaultexpanded: [1], //index of content(s) open by default [index1, index2, etc]. [] denotes no content.
    Note that if you have persistence enabled, you'll want to close the browser and reopen it to see the default expanded feature actually kick in.

  3. The Following User Says Thank You to ddadmin For This Useful Post:

    logicSix (03-14-2008)

  4. #3
    Join Date
    Mar 2007
    Posts
    9
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    ok, i will give it a shot and let you know...

  5. #4
    Join Date
    Mar 2007
    Posts
    9
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    i cannot to get it to work. here is my 'navigation'

    Code:
              <div class="arrowlistmenu">
                          <h3 class="menuheader" style="cursor: default"><a href="../index.php">Home</a></h3>
                          <h3 class="menuheader expandable">For Birth Parents </h3>
                          <ul class="categoryitems">
                            <li><a href="../birth_parents/options.php">What Are My Options?</a></li>
                            <li><a href="../birth_parents/who.php">Who's Going to Adopt My Baby? </a></li>
                            <li><a href="../birth_parents/what.php">What's Going to Happen To Us? </a></li>
                            <li><a href="../birth_parents/dad.php">What About the Dad? </a></li>
                            <li><a href="../birth_parents/next.php">What's The Next Step?</a></li>
                            <li><a href="../birth_parents/help.php">Where Can I Turn for Help?</a></li>
                          </ul>
                          <h3 class="menuheader expandable">For Adoptive Parents </h3>
                          <ul class="categoryitems">
                            <li><a href="../adoptive_parents/options.php">What Are My Options?</a></li>
                            <li><a href="../adoptive_parents/who.php">Who Put Their Baby up for Adoption?</a></li>
                            <li><a href="../adoptive_parents/process.php">How Does The Process Work? </a></li>
                            <li><a href="../adoptive_parents/how.php">Cost &amp; Length of Time </a></li>
                            <li><a href="../adoptive_parents/what.php">What Do I Need To Do? </a></li>
                            <li><a href="../adoptive_parents/what_else.php?f=6">What Else Should I Know? </a></li>
                          </ul>
                          <h3 class="menuheader expandable">For Adoptees </h3>
                          <ul class="categoryitems">
                            <li><a href="../adoptees/index.php">The Search Effects </a></li>
                            <li><a href="../adoptees/effect.php">The Effect</a></li>
                            <li><a href="../adoptees/reunion.php">The Reunion</a></li>
                            <li><a href="../adoptees/resources.php">Resources</a></li>
                          </ul>
                          <h3 class="menuheader" style="cursor: default"><a href="../professionals/index.php">For Professionals</a></h3>
                          <h3 class="menuheader expandable">About Us </h3>
                          <ul class="categoryitems">
                            <li><a href="../about/who.php">Who Are We? </a></li>
                            <li><a href="../about/why.php">Why Did We Start FFTA? </a></li>
                            <li><a href="../about/board.php">Our Advisory Board </a></li>
                          </ul>
                          <h3 class="menuheader expandable">That Says It All</h3>
                          <ul class="categoryitems">
                            <li><a href="../testimonials/words.php">In Words</a></li>
                            <li><a href="../testimonials/pictures.php">In Pictures</a></li>
                          </ul>
                   <h3 class="menuheader" style="cursor: default"><a href="index.php">How Can We Help? </a></h3>
                        </div>
    is there anything i need to change? i have it looking and opening/closing the way i want but i cannot seem to have one area open on default. What can be done to fix this?

  6. #5
    Join Date
    Dec 2006
    Posts
    27
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default

    Did you change what DDAdmin asked you to change? Post your initialization code from the <head> of your document as well so we can see what you've done there.

  7. #6
    Join Date
    Mar 2007
    Posts
    9
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    i changed the default expanded to '0' to keep the first one open. did i screw it up...?

    Code:
    ddaccordion.init({
    	headerclass: "expandable", //Shared CSS class name of headers group that are expandable
    	contentclass: "categoryitems", //Shared CSS class name of contents group
    	collapseprev: true, //Collapse previous content (so only one open at any time)? true/false 
    	defaultexpanded: [0], //index of content(s) open by default [index1, index2, etc]. [] denotes no content
    	animatedefault: false, //Should contents open by default be animated into view?
    	persiststate: true, //persist state of opened contents within browser session?
    	toggleclass: ["", "openheader"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
    	togglehtml: ["prefix", "", ""], //Additional HTML added to the header when it's collapsed and expanded, respectively  ["position", "html1", "html2"] (see docs)
    	animatespeed: "normal" //speed of animation: "fast", "normal", or "slow"
    })

  8. #7
    Join Date
    Dec 2006
    Posts
    27
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default

    Looks good to me. Do you have a link that you can share regarding these pages?

  9. #8
    Join Date
    Mar 2007
    Posts
    9
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    brady

    here: http://development.fluidred.com/ffta/

    the user is devel, password is password. i will keep it like this for 2 days

  10. #9
    Join Date
    Dec 2006
    Posts
    27
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default

    Here's one problem... you have the same initialization code on EVERY page.

    You have this:
    Code:
    ddaccordion.init({
    	headerclass: "expandable", //Shared CSS class name of headers group that are expandable
    	contentclass: "categoryitems", //Shared CSS class name of contents group
    	collapseprev: true, //Collapse previous content (so only one open at any time)? true/false 
    	defaultexpanded: [0], //index of content(s) open by default [index1, index2, etc]. [] denotes no content
    	animatedefault: false, //Should contents open by default be animated into view?
    	persiststate: true, //persist state of opened contents within browser session?
    	toggleclass: ["", "openheader"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
    	togglehtml: ["prefix", "", ""], //Additional HTML added to the header when it's collapsed and expanded, respectively  ["position", "html1", "html2"] (see docs)
    	animatespeed: "normal" //speed of animation: "fast", "normal", or "slow"
    })
    ... notice the code in red. That is telling every page to open, by default, the first expandable section.

    If you want all the pages under "For Adoptive Parents" to be expanded by default, you should change the code in red above to be:
    Code:
    defaultexpanded: [1],
    If you want all the pages under "For Adoptees" to be expanded by default, you should change the code in red above to be:
    Code:
    defaultexpanded: [2],
    etc., etc.

    And I'm guessing here, but I think that you need to turn off the persistence state.
    Code:
    persiststate: false,
    Try the first part and see what happens. If it's still not quite right, try to turn off the persistence.

  11. The Following User Says Thank You to bradymc For This Useful Post:

    logicSix (03-20-2008)

  12. #10
    Join Date
    Mar 2007
    Posts
    9
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    i will give this a shot and see what happens. Thanks a bunch

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
  •