I have a custom right click context menu that is displayed when the page is right clicked. After a right click event, if the user clicks on the page then the context menu is hidden. The problem I need resolved is if the user clicks on the context menu (to select a drop down) then the context menu is hidden by the jQuery onClick event. Is there any way to identify the div of the element being clicked so that I can then decide whether or not to hide the menu from there?
$('body').on('contextmenu', options.contextMenu.graphName, function (event) {
showContextMenu(event);
});
$(document).bind('click', function (event) {
//if(event.targetDiv.id != '#graphMenu') <- Is something like this possible?
$('#graphMenu').hide();
});