Accordion Menu / Posts /

Collapsing all items on site open

31
Hello All! I have installed the Accordian menu, but can't figure out how to have all the Main Items and Subs be collapsed from the start, I don't want any sub-menu items showing when a visitor first lands on a page in the site, only the main categories. I am not skilled with Java, so a "dummies" explanation would be much appreciated!  My first main category is open, the 2 additional categories are collapsed. Thank you in advance!
Andrea C  11 years ago   viewed: 10955    

6 Answers

6
 amenu.close closes just the first  node of your list. Also if you do something like <script>amenu.open("li1", true);amenu.close(false);</script> like I did, it doesn�t work. That�s because the close property doesn�t change the class of the div. That�s why the first item it�s always gonna be shown. If you want all your items collapsed you have to force width = 0 as an UL property while you are creating it!!! Hope it works!!! Suits for me!! :)
Gonzalo
  10 years ago
-1
Close all menu item without opening is the best solution.

Another approach is to add the following code to your page:
<script> amenu.close(false); </script>

For details please read the "Using the open or close function" section under the JavaScript tab in page Accordion Menu
Milo   11 years ago
1

<script> amenu.close(false); </script> do not work for me :(

Any other suggestions are welcome!!

WebCare
  8 years ago
-3
Hi Milo, Thank you.  Too simple! You're my hero!!! =)
AndreaC   11 years ago
1
I have try  <script> amenu.close(false); </script>, but the last menu item was expand on site open.
Annie   11 years ago
0

1. Try put the link of accordionmenu.js to be the first link in the page so that the script will run earlier as soon as the page is loaded;

2. Try the #3 in http://www.menucool.com/2457/Troubleshooting-Request

Milo   8 years ago

   

Your name*
Password
(Optional. Used to modify this post afterwords)
+ =  

Ask your Own Question

  • If your question is related to the topic of this post, you can post your question to this page by clicking the "Post a reply" button at left;

  • When you want to start a new page for your question: