Results 1 to 3 of 3

Thread: ddaccordion : adding expandone after init

  1. #1
    Join Date
    Apr 2008
    Location
    France
    Posts
    12
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default ddaccordion : adding expandone after init

    Hello,

    1) Script Title: Accordion Content script

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


    3) Describe problem:

    I included the ddaccordion.init in a file (as base.js) with my defaults parameters on all html sheets. It is configured to expand first header at init.

    But from time to time, in a few sheets, I want first and second to be expanded.

    So I added this line :
    Code:
    <script type="text/javascript">ddaccordion.expandone('collapsehead', 1);</script>
    (in <head> or <body>)
    But this does not work : only first is expanded.
    I do not understand why. How to make it works ?
    (I would like not to use extra parameter on URL)

    Note that I am new to javascript...

    Christophe

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    If you want both 1st and 2nd headers to be expanded, make sure in your configuration code, you've set:

    Code:
    collapseprev: true, //Collapse previous content (so only one open at any time)? true/false
    to false. Then it's just a matter of choosing one of the two ways explained here to expand the desired headers.

  3. #3
    Join Date
    Apr 2008
    Location
    France
    Posts
    12
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    OK. There is no way to expand one header as I wanted. I will use different init code for these html sheets.

    Btw, thanks for your nice works.

    Christophe

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
  •