Results 1 to 7 of 7

Thread: Glossy Accordion Menu -Just want menu to start as expanded

  1. #1
    Join Date
    Dec 2008
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Glossy Accordion Menu -Just want menu to start as expanded

    1) Script Title:
    Glossy Accordion Menu
    2) Script URL (on DD):
    http://www.dynamicdrive.com/dynamici...enu-glossy.htm
    3) Describe problem:
    As the title says the problem
    "Just want menu to start as expanded"
    I want the submenus start as expanded when I open the page
    Last edited by Memet; 12-06-2008 at 05:34 PM.

  2. #2
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    2,023
    Thanks
    17
    Thanked 319 Times in 318 Posts
    Blog Entries
    3

    Default

    Find this code in the .html file:
    Code:
    ddaccordion.init({
    	headerclass: "submenuheader", //Shared CSS class name of headers group
    	contentclass: "submenu", //Shared CSS class name of contents group
    	revealtype: "click", //Reveal content when user clicks or onmouseover the header? Valid value: "click" or "mouseover
    	mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover
    	collapseprev: true, //Collapse previous content (so only one open at any time)? true/false 
    	defaultexpanded: [], //index of content(s) open by default [index1, index2, etc] [] denotes no content
    And change the collapseprev to false to allow multiple menus open at the same time. Then add numbers to defaultexpanded starting with 0 for every menu you want to start expanded. Here's an example if you want the first three menus to start expanded:
    Code:
    ddaccordion.init({
    	headerclass: "submenuheader", //Shared CSS class name of headers group
    	contentclass: "submenu", //Shared CSS class name of contents group
    	revealtype: "click", //Reveal content when user clicks or onmouseover the header? Valid value: "click" or "mouseover
    	mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover
    	collapseprev: false, //Collapse previous content (so only one open at any time)? true/false 
    	defaultexpanded: [0,1,2], //index of content(s) open by default [index1, index2, etc] [] denotes no content
    When counting the menus, count only those that have submenus.

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

    Memet (12-06-2008)

  4. #3
    Join Date
    Dec 2008
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Thanks but I'm using it on a forum system to expand/collapse the categories like here in the pic.

    And I dont know how many categories will my friend does when he decides those categories.I mean how could I expand all of them?

  5. #4
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    2,023
    Thanks
    17
    Thanked 319 Times in 318 Posts
    Blog Entries
    3

    Default

    No problem:
    Code:
    defaultexpanded: [all],

  6. #5
    Join Date
    Dec 2008
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    When I write like that it just stops collapsing,it stays there being expanded

  7. #6
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    2,023
    Thanks
    17
    Thanked 319 Times in 318 Posts
    Blog Entries
    3

    Default

    Yes, I just noticed, that is because of the script in the .js files which requires the value to be an array. Javascript is not my strong side, maybe ddadmin can chip in. Until then, you could just write as many numbers as you think you need:
    Code:
    defaultexpanded: [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],
    That will work if you have between one and sixteen categories you need to be expanded. That means that if you have more than that, the rest or the menus will not be expanded but since you will have categories for a forum, I'm guessing you won't have more than 15-20. To be safe you could go up to 50 or a hundred.

  8. #7
    Join Date
    Dec 2008
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Well thanks anyway , I will wait if ddadmin answers,thanks a lot

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
  •