Results 1 to 8 of 8

Thread: Glossy accordion menu open automatically

  1. #1
    Join Date
    Apr 2008
    Location
    Illinois
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Question Glossy accordion menu open automatically

    1) Script Title: Glossy accordion menu

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

    3) Describe problem: I will like to have the menu open up imediatly when the page opens without having to click on the menu. I have two submenus and would like the first one to open up, I cant figure out what to do, I really appreciate all the help.

  2. #2
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    There is a defaultexpanded paramter in the ddaccordian.init function. You just need to set that.

    Here is the example on the script's page. Notice the highlighted part.

    Code:
    ddaccordion.init({ //top level headers initialization
    	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"
    	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
    	}
    })

  3. #3
    Join Date
    Apr 2008
    Location
    Illinois
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Yes I see that and I tried setting it to 0 and submenu this is for the glossy menu but nothing happens. The menu drops down in all the other pages once i have cliked one open. But it does not open automatically when the page is loaded to a new browser page. Thanks for the help.


    my code looks like this
    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:true, //Should contents open by default be animated into view?
    	persiststate: true, //persist state of opened contents within browser session?
    	toggleclass: ["", "selected"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
    	togglehtml: ["suffix","<img src='images/plus.gif' class='statusicon' />", "<img src='images/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"
    	ooninit:function(headers, expandedindices){ //custom code to run when headers have initalized
     myiframe=window.frames["myiframe"] //reference and cache iframe to populate
     var lastexpandedindex=expandedindices.pop() //get last index within array
     myiframe.location.replace(headers[lastexpandedindex].getAttribute('title')) //load page associated with expanded header
    },
    onopenclose:function(header, index, state, isclicked){ //custom code to run whenever a header is opened or closed
     if (state=="block" && isclicked==true){ //if header is expanded and as the result of the user clicking on it
      myiframe.location.replace(header.getAttribute('title'))
     }
    }
    })

  4. #4
    Join Date
    Apr 2008
    Location
    Illinois
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Im sorry I need to be more specific, well it works in IE but not in Firefox when i set it to 0.

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

    Default

    Hmmm I'll need to see the problem pagePlease post a link to the page on your site that contains the problematic script so we can check it out.

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

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

    Default

    Try upgrading to the latest version of ddaccordion.js Just go to the script page and replace your current .js file with the most recent ddaccordion.js That should fix the default open issue in FF.

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

    ypadill2 (05-09-2008)

  9. #8
    Join Date
    Apr 2008
    Location
    Illinois
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    I did that, i replaced the js file but it still does not want to expand automatically in firefox, Do i need to set the defaultexpanded: [] to something else besides 0 in order for it to work?

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
  •