PDA

View Full Version : The submenu is open by default



Jannie-kit
03-27-2012, 09:07 PM
1) Script Title: Arrow Side Menu

2) Script URL (on DD):


<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

ddadmin
03-28-2012, 08:14 PM
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.

Jannie-kit
03-29-2012, 08:13 PM
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

ddadmin
03-30-2012, 08:55 AM
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?

Jannie-kit
03-31-2012, 03:01 PM
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 (http://www.kreativkit.dk/byggeri.html) it closes immediately so you can not click the other menu items under Byggeri (http://www.kreativkit.dk/byggeri.html).

Regards Jannie

Jannie-kit
03-31-2012, 03:06 PM
It must remain open when there are menu items in the submenu

ddadmin
03-31-2012, 08:37 PM
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.