Sample: dhtmlxMenu Initializing menu object dhtmlxMenu main page
X

Menu buttons can be references


 
<div id="menu_zone" style="width:600; height:50;"/>
<script>
 
        //init menu
        aMenuBar=new dhtmlXMenuBarObject('menu_zone','100%',30,"Demo menu");
        // set processing function
        aMenuBar.setOnClickHandler(onButtonClick);
        //set path to imgs folder
        aMenuBar.setGfxPath("../../codebase/imgs/");
        //load menu from xml
        aMenuBar.loadXML("_menu.xml")
        //show menu
        aMenuBar.showBar();
        
        function onButtonClick(itemId,itemValue)
        {
            alert("Button "+itemId+" was pressed"+(itemValue?("\n select value : "+itemValue):""));
        };
</script>

Parameters passed to the constructor are:
  • object to attach menu to (should be loaded before calling constructor)
  • width of the menu
  • height of the menu
  • title of menu