Board Logo

How to hide the menu using javascript?
magoicochea - 6/4/2007 at 03:58 PM

Hello

I have the menu created at the end of the HTML with the instructions:

<script language="JavaScript">
<!--
new menu (MENU_ITEMS, MENU_POS);
-->
</script>

However, I also have a button whose purpose is to hide the menu. How can I make the Tigra menu dissappear and make it appear once again when the button is clicked again?


tigra - 6/4/2007 at 05:44 PM

There is no documented method to do that by a single function call.
You'll need get the references to the menu's elements and switch their visibility property. See the menu's source code for the naming convention of the menu's elements.


magoicochea - 6/4/2007 at 07:57 PM

Thanks,

doing this with every item of the A_MENUS collection seems to solve the problem:

for (var n_order = 0; n_order < menu.a_children.length; n_order++)
menu.a_children[n_order].e_oelement.style.display = 'none';


Softcomplex: http://www.softcomplex.com/
Back to forum: http://www.softcomplex.com/forum/