Hi everyone,
I’m trying to display a context menu when left clicking on div I created, but the context menu isn’t showing up.
<div id="test" onclick="menu.showContextMenu(10, 10);">Menu here!</div>
<script type="text/javascript">
var menu;
menu = createContextMenu();
function createContextMenu() {
var newMenu = new dhtmlXMenuObject(null, "dhx_skyblue");
[...]
return newMenu;
}
</script>
I can get it to come up just fine if I call menu.showContextMenu(…) directly from the JavaScript console, but not from any mouse event. I’ve tried jQuery click(), mouseup(), mousedown() and the example above is using a regular onclick handler. Nothing seems to work. Any ideas?
Thanks!