DHTMLX Docs & Samples Explorer

Initialization of Context Menu


Source
<link rel="stylesheet" type="text/css" href="../../codebase/skins/dhtmlxmenu_dhx_skyblue.css">
<script  src="../../codebase/dhtmlxcommon.js"></script>
<script  src="../../codebase/dhtmlxmenu.js"></script>
 
<div style="height: 400px; position: relative;">
    <div id="contextArea" style="position: absolute; left: 100px; top: 100px; width: 100px; height: 60px; border: #C1C1C1 1px solid; background-color: #E7F4FF;"></div>
</div>
 
<br>
<script>
var menu;
function initMenu() {
    menu = new dhtmlXMenuObject("contextArea");
    menu.setIconsPath("../common/imgs/");
    menu.renderAsContextMenu();
    menu.loadXML("../common/dhxmenu.xml?e=" + new Date().getTime());
}
</script>