Results 1 to 7 of 7

Thread: Accordion Menu doesn't start expanded

  1. #1
    Join Date
    Apr 2008
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Accordion Menu doesn't start expanded

    1) Script Title: Glossy Accordion Menu

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

    3) Describe problem: I've got it installed at http://www.yourstorewizards.com and it's working fine but I want to get the first section on the left nav to automatically start opened. I've got defaultexpanded set to 0 but that doesn't do it (and I've tried all the combinations I can think of). I'm probably missing something minor but any help is appreciated.

    Thanks.

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

    Default

    Hmm where is your initialization code located? This part that is:

    Code:
    ddaccordion.init({
    	headerclass: "submenuheader", //Shared CSS class name of headers group
    	contentclass: "submenu", //Shared CSS class name of contents group
    	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
    	animatedefault: false, //Should contents open by default be animated into view?
    	persiststate: true, //persist state of opened contents within browser session?
    	toggleclass: ["", ""], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
    	togglehtml: ["suffix", "<img src='plus.gif' class='statusicon' />", "<img src='minus.gif' class='statusicon' />"], //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"
    	oninit:function(headers, expandedindices){ //custom code to run when headers have initalized
    		//do nothing
    	},
    	onopenclose:function(header, index, state, isclicked){ //custom code to run whenever a header is opened or closed
    		//do nothing
    	}
    })
    It's hard to tell, since you have so many .js references on that page.

  3. #3
    Join Date
    Apr 2008
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I realized last night as I was falling asleep that it would be hard to find. The settings are actually loaded in the file at http://lib.store.yahoo.net/lib/rtmlt...ionsettings.js

    Thanks.

  4. #4
    Join Date
    Apr 2008
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Okay, I removed most of the page and left pretty much the nav without very little other html and still can't figure out what I'm doing wrong. the new test page is at http://dts.yourstorewizards.com/don/accordion.html

    Can anyone take a look and let me know if I'm just not understanding the setting to get the first section to open by default?

  5. #5
    Join Date
    Apr 2008
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Okay, I guess I have to backtrack as now it's working. I'm guessing something when I moved it and cleaned it all out made it work (Wasn't working locally with the same code). So nevermind for now.

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

    Default

    Actually this may be my fault. There was a bug in ddaccordion.js that prevented the defaultexpanded setting from working. This was fixed on April 9th (only the .js file changed).

  7. #7
    Join Date
    Apr 2008
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks so much. I downloaded the new file and it seems to have fixed it. Glad I'm not going crazy.

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
  •