Accordion Menu / Posts /

Collapse Top Level Menu Item At Loading Time


I am a licensed customer.  I would like to have all the top level menu items collapsed at page loading time.  I have tried to add <script>amenu.close(false);</script> in the <head> section but it did not work.  I also tried to add width="0" at <ul> tag and it did not help either.  I then tried to add ids to <li>, such as <li id="top_a">, and used top_a.close(false) to control and it did not work either.  I am pasting my source code here.  Any help would be greatly appreciated:

<!DOCTYPE html>
<title>Accordion menu</title>
<link href="menu/accordionmenu.css" rel="stylesheet" type="text/css" />
<script src="menu/accordionmenu.js" type="text/javascript"></script>
<script>amenu.close(false); top_a.close(false);  top_b.close(false);  top_c.close(false);


<div id="acdnmenu">
<li id="top_a"><a href="#">Top A</a>
  <li>Sub A1</li>
     <li>Sub A2</li>
<li id="top_b"><a href="#">Top B</a>
  <li>Sub B1</li>
     <li>Sub B2</li>
<li id="top_c"><a href="#">Top C</a>
  <li>Sub C1</li>
     <li>Sub C2</li>


Julia L  10 years ago   viewed: 5077    


Your name*
(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: