A vBMenu popup consist of two elements: The popup control, and the popup itself. Any popup can have any number of controls, and clicking any one of the controls will open the popup immediately below the control.
Each vBMenu popup must have a unique identifying name, which will be used by the vBMenu system to distinguish popups from each other and allows popup controls to communicate with their associated popup elements.
For our example, we will call our vBMenu MyMENU.
The HTML code for a vBMenu popup control looks like this:
<td id="MyMENU" class="vbmenu_control"> <a href="#">My vBMenu Example</a> <script type="text/javascript"> vbmenu_register("MyMENU"); </script> </td>
- A block-level tag (<td>, <div> etc.) with an id attribute using the vBMenu identifying name (in this case, MyMENU).
- A hyperlink (the href attribute of which should point somewhere relevant to the menu).
- A Javascript block containing a call to the vbmenu_register() function, using the vBMenu identifying name as the argument to the function.
<script type="text/javascript"> vbmenu_register("MyMENU", true); </script>
<div class="vbmenu_popup" id="MyMENU_menu" style="display:none"> <!-- Any HTML here will be a part of the vBMenu popup identified as 'MyMENU' --> </div>
- Must use the vbmenu_popup CSS class
- Must be identified by 'MenuName_menu' (In our example, 'MyMENU_menu' would be the correct id)
- Must have a style="display:none" CSS attribute