Results 1 to 3 of 3

Thread: Help needed on Accordion menu

  1. #1
    Join Date
    Mar 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Help needed on Accordion menu

    1) Script Title: Bullet List Accordion Menu

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

    3) Describe problem: hello everyone,
    i have been using DD scripts from some time, but i am new on this forum.

    i am using this this accordion menu on a website. i read the forum for the help on this menu, but to no avail.

    The menu works perfectly with the features given on the above page. but in addition to expanding the submenu when one clicks on the header, i also need to open another page. Header itself is also a link.

    Now there is a function called onopenclose(),
    but it is called only when a header collapses or expands.
    but in my case, if the header is open, it is required to remains open. even on clicking on it. i have set onemustopen=true
    so this function is not triggered when that header is clicked.

    my code is like this
    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
    	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: [1], //index of content(s) open by default [index1, index2, etc]. [] denotes no content
    	onemustopen: true, //Specify whether at least one header should be open always (so never all headers closed)
    	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: "slow", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow"
    	oninit:function(headers, expandedindices){ //custom code to run when headers have initalized
    		//do nothing
    	},
    	onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
    			if(index ==0 && document.location != "Payments.html" && isuseractivated){
    				document.location = "Payments.html";
    			}
    			if(index ==1 && document.location != "BackOfficeMgmt.html" && isuseractivated){
    				document.location = "BackOfficeMgmt.html";
    			}
    		//do nothing
    	}
    })
    </script>
    i really need this badly. Can somebody suggest a solution for this?
    i would really appreciate your help. thanks

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

    Default

    There are quite a few threads on getting the header to still act as a link when it's used to toggle its sub contents onClick. One such solution by John can be found here. Just do a search for "accordion menu header click" for example for other examples.
    DD Admin

  3. #3
    Join Date
    Mar 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up

    wow, the script on the link u gave works wonderfully for me.

    thank you so much admin and to all people who create these wonderful scripts.

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
  •