Results 1 to 7 of 7

Thread: The submenu is open by default

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

    Default The submenu is open by default

    1) Script Title: Arrow Side Menu

    2) Script URL (on DD):

    Code:
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
    
    <script type="text/javascript" src="Menu/ddaccordion.js">
    
    
    /***********************************************
    * Accordion Content script- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
    * Visit http://www.dynamicDrive.com for hundreds of DHTML scripts
    * This notice must stay intact for legal use
    ***********************************************/
    
    </script>
    
    
    <script type="text/javascript">
    
    //Initialize Arrow Side Menu:
    ddaccordion.init({
    	headerclass: "menuheaders", //Shared CSS class name of headers group
    	contentclass: "menucontents", //Shared CSS class name of contents group
    	revealtype: "clickgo", //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: false, //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: ["unselected", "selected"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
    	togglehtml: ["none", "", ""], //Additional HTML added to the header when it's collapsed and expanded, respectively  ["position", "html1", "html2"] (see docs)
    	animatespeed: 500, //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow"
    	oninit:function(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
    		//do nothing
    	}
    })
    
    </script>
    3) Describe problem:

    I have downloaded a dropdown menu here and it does not work right after my intention.

    The submenu is open and must be closed when visiting the site, the submenu does not close when clicking on other menu items and it must.

    It runs on this website - www.kreativkit.dk

    Is deeply grateful if anyone can help me.

    Regards Jannie
    Last edited by ddadmin; 03-30-2012 at 08:45 AM.

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

    Default

    Hmm not sure if I'm understanding your question correctly, but I assume it's made up of two parts:

    1) The submenu is open and must be closed when visiting the site

    Do you mean you wish all sub menus to be closed by default when the user visits your page? If so make sure persiststate option is set to false inside your configuration code.

    2) the submenu does not close when clicking on other menu items and it must.

    See 1) above, which should also address this issue.
    DD Admin

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

    Jannie-kit (03-31-2012)

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

    Default persiststate: false,

    Hi

    Many thanks for your time

    I can understand that you have trouble understanding my English I'm not good at writing in English, but you understood the question correctly, I changed the code to false but it still does not work. If you look at www.kreativkit.dk you see either on one or the other problem is solved, click on the menu Byggeri afterwards click the menu Handel, you can see what I mean.

    Do you have other suggestions on what I can do? I am new at this but I do/try my best.

    Thanks again for your help

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

    Default

    You say:

    click on the menu Byggeri afterwards click the menu Handel, you can see what I mean.
    When I do this, I end up at http://www.kreativkit.dk/index.html eventually, with all of the expandable headers contracted. Are you saying one of the headers appears expanded to you?
    DD Admin

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

    Jannie-kit (03-31-2012)

  7. #5
    Join Date
    Mar 2012
    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Hi
    Now it's becoming embarrassing, excuse me many times.

    Now I think it works as intended, but now there is another problem when I click on Byggeri it closes immediately so you can not click the other menu items under Byggeri.

    Regards Jannie

  8. #6
    Join Date
    Mar 2012
    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Question

    It must remain open when there are menu items in the submenu

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

    Default

    Now I think it works as intended, but now there is another problem when I click on Byggeri it closes immediately
    That's because persiststate is now set to false, since your original post asked how to have all sub menus collapsed when visiting another page. You might try setting the option revealtype to just "go" to prevent the menu from going to a page when expanded.
    DD Admin

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
  •