var menu = new dhtmlXMenuObject(parent, skin)
where
<div id='my_menu_here' style="width: 500px;"> </div> <script> // common init code var menu = new dhtmlXMenuObject("my_menu_here"); </script>
dhtmlxLayout, dhtmlxWindow, dhtmlxAccordion and dhtmlxTabbar can create a menu inside their cells by using the following syntax:
// attach to dhtmlxLayout dhxLayout.attachMenu(); dhxLayout.cells(id).attachMenu(); // attach to dhtmlxWindow dhxWins.window(id).attachMenu(); // attach to dhtmlxAccordion dhxAcc.cells(id).attachMenu(); // attach to dhtmlxTabbar dhxTabbar.cells(id).attachMenu();
Starting from 2.5 version, menu can be initialized by object notation
var menu = new dhtmlXMenuObject({ some_option1: some_value_1, some_option2: some_value_2, ... some_optionN: some_value_N, })
menu = new dhtmlXMenuObject({ parent:"a_menu", image_path:"codebase/imgs/", onClick:function(){ alert("Menu item was clicked"); } });