Results 1 to 5 of 5

Thread: having 2 accordion menus on one page

  1. #1
    Join Date
    Jul 2008
    Location
    boston, ma
    Posts
    88
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Default having 2 accordion menus on one page

    Hi,
    I have 2 accordion menus from dynamicdrive on my page. I want both of them to be open on page load and be independent of eachother. Right now one is open on load, and if you click on the second one to expand it, the first one closes. How can I make it so both are open and one doesn't close when you open the other one
    site
    Any suggestions?

    Thanks
    Last edited by Irishcash33; 12-08-2008 at 05:11 PM.

  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

    In future, please post about Dynamic Drive Scripts in the Dynamic Drive Scripts Help section here where I've moved this thread, and:

    Warning: Please include a link to the DD script in question in your post. See this thread for the proper posting format when asking a question.
    Last edited by jscheuer1; 12-08-2008 at 06:10 PM. Reason: more info needed
    - John
    ________________________

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

  3. #3
    Join Date
    Jul 2008
    Location
    boston, ma
    Posts
    88
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Default

    Here is the link to the DD menu

  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

    First of all, get rid of this:

    Code:
    <script type="text/javascript">
    <!--
    var Accordion1 = new Spry.Widget.Accordion("Accordion1");
    //-->
    </script>
    You are not using it any longer and it causes an error.

    Now, if you look at the main script page for accordion:

    http://www.dynamicdrive.com/dynamici...daccordion.htm

    You will see that in order to have two accordions, you need to have two inits. So you really have only one menu on your page, it's just spread out between two places. (see Step 1 on the above demo page)

    However, it's not made clear, but I imagine that in order for the inits to address two separate menus, each must use unique headerclass and contentclass class names. The css style rules for these may be the same, so that the look of both menus can be the same, but it looks like you need unique names used with separate inits to get unique menus. These unique class designation would then be reflected in the two menu's markup, with one set being used in one menu's markup, and the second set being used in the other menu's markup.
    - John
    ________________________

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

  5. #5
    Join Date
    Jul 2008
    Location
    boston, ma
    Posts
    88
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Default

    Thanks!!
    This works fine. I made a second inits and renamed the header and content classes, and it seems to work.

    Thanks

    Will

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
  •