Results 1 to 5 of 5

Thread: Accordion Menu script (v1.3)

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

    Default Accordion Menu script (v1.3)

    1) Script Title: Accordion Menu script (v1.3)

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

    3) Describe problem: I am using the code as an include on a PHP page.
    This now causes a problem. When you click a link from
    the expanded links the code leaves the accordion open.
    Here is my webpage to view what I am talking about.
    http://www.zentyx.com/
    If you expand the Tutorials 'n stuff then click the MOHAA scripting (videos) you will be directed to that page.
    But notice how the links are still expanded. Is it possible to have an automatic close once the link is clicked?

    Thank you for your time.
    Last edited by Zenguy; 05-27-2008 at 12:54 PM. Reason: Have a new question

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

    Default

    Sorry for the bump, but I have posted a new question.
    Thank you for your time and help.

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

    Default

    This is due to persistence of the accordion state being turned on. Inside the configuration portion, simply set that to false:

    Code:
    persiststate: false, //persist state of opened contents within browser session?

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

    Zenguy (05-28-2008)

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

    Default

    Thank you.
    So I assume that line goes in the ddaccordion.js file?
    I did add that code, just below...
    Code:
    contentclassname:{}, //object to store corresponding contentclass name based on headerclass
    But it's not working with that attempt.

    Can you please let me know if I atleast put it in the correct spot?

    Thank you

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

    Default

    No, what I posted is part of the configuration code you used to initialize each Accordion content. For example:

    Code:
    <script type="text/javascript">
    
    ddaccordion.init({
    	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: false, //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
    	}
    })
    
    </script>

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
  •