Easy Menu provides two JavaScript functions that can be used to hide or show hidden menu items at client side:
HideItem - has the following syntax:
ob_em_EasyMenuID.HideItem(id)
· id - The id of the item to hide.
ShowItem - method has the following syntax:
ob_em_EasyMenuID.ShowItem(id)
· id - The id of the item to show.
Note:
- EasyMenuID is the id of the Easy Menu to which we want to hide/show the item.
- document.getElementById("EasyMenuID").object is the same as ob_em_EasyMenuID.
Test hiding and showing items to the menu on the right (make sure you enter unique IDs):
Here is the code for the buttons:
<input type="button" value="Hide Item"
onclick="ob_em_EasyMenu1.HideItem(document.getElementById('hide_itemId').value);">
<input type="button" value="Show Item"
onclick="ob_em_EasyMenu1.ShowItem(document.getElementById('show_itemId').value);">