Link to home
Start Free TrialLog in
Avatar of kingdsa
kingdsa

asked on

Left Menu Cascade

Can anyone provide me or direct me to the code to create a vertical, left hierarchical menu bar on a web page in Javascript? Not a top menu but a left menu bar.

Any help will be appreciated.
ASKER CERTIFIED SOLUTION
Avatar of zhanshi
zhanshi

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of cgarvey80
cgarvey80

Try putting this in your header

<script language="javascript">
function toggleFolder()
{
      // Get a reference to the clicked object
      var clicked = event.srcElement;
      // Move to the next object which we know to be the list.
      clicked = clicked.all.tags("ul")[0];
      // If the list is displayed, then hide it. If not, then display it.
      if (clicked.style.display != "block")
            clicked.style.display = "block";
      else
            clicked.style.display = "none";
      // Uncomment the next line to debug
      //alert(clicked.id + " " + clicked.style.display);
      return true;
}
document.onclick=toggleFolder;
</script>

Then, use this structure for entries
<ul>
   <li>Menu</li>
   <ul>
      <li>Option 1</li>
      <li>Option 2</li>
      <li>Option 3</li>
      <li>Submenu</li>
      <ul>
         <li>Option1</li>
      </ul>
   </ul>
</ul>
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Split: zhanshi {http:#9031190} & travisjbennett {http:#9031293} & sciwriter {http:#9031645} & COBOLdinosaur {http:#9032219}

Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jAy
EE Cleanup Volunteer