I cannot get it to work:
<head>
<script>
menu = new dhtmlXMenuObject("CMS__help_optmenu", "dhx_skyblue");
menu.addNewSibling(null, "root", "Options", false);
menu.addNewChild("root", 0, "navi", "Navigate", false);
menu.addNewChild("navi", 0, "back", "Back", false);
menu.addNewChild("navi", 1, "forward", "Forward", false);
menu.addNewChild("navi", 2, "stop", "Stop", false);
menu.addNewChild("navi", 3, "refresh", "Refresh", false);
menu.addNewChild("navi", 4, "home", "Home", false);
menu.addCheckbox('child', 'root', 1, 'show_tree', 'Show menu tree', true, false);
menu.addCheckbox('child', 'root', 2, 's_highlight', 'Highlight search results', true, false);
menu.addNewChild("root", 3, "print", "Print", false);
menu.setHotKey('back', 'ALT+B');
menu.setHotKey('forward', 'ALT+F');
menu.setHotKey('stop', 'ALT+S');
menu.setHotKey('refresh', 'ALT+R');
menu.setHotKey('home', 'ALT+H');
menu.setHotKey('print', 'ALT+P');
menu.addNewSeparator("navi", 'sep_1');
menu.addNewSeparator("s_highlight", 'sep_2');
menu.setHref('back', 'javascript:history.go(-1);', '_self');
menu.setHref('forward', 'javascript:history.go(1);', '_self');
menu.setHref('stop', 'javascript:window.stop();', '_self');
menu.setHref('refresh', 'javascript:window.location.reload();', '_self');
menu.setHref('home', './help.php?contentID=home', '_self');
</script>
</head>
<body>
<div id="button_option" onclick="menu.showContextMenu(30,50);">Open my menu</div>
</body>
It never opens any menu when i perform a onclick event on my div.
I also tried adding the following, but that gave me the js error “polygon is undefined”:
menu.renderAsContextMenu();
menu.addContextZone('button_option);
Any suggestions? Thank you in advance!