I'm using CKeditor 4, and have a context menu that works perfectly well. I want to be able to invoke this context menu when a user left-clicks on a particular element. I've tried numerous things, but simply cannot invoke the context menu. The following JQuery code did everything except invoke the context menu:
$(document).click(function(e) { if((e.target.nodeName == 'TD')||(e.target.nodeName == 'TR')||(e.target.nodeName == 'TH')){ var tid=$('#'+e.target.id).closest('table').attr('id'); if(tid=='mytable'){ //$('#'+e.target.id).trigger({type:'mousedown',button:2}).trigger({type:'mouseup'}); //$('#'+e.target.id).triggerHandler('contextmenu'); $('#'+e.target.id).triggerHandler('contextMenu'); } } });
My web searches came up with quite a few references to it being impossible to simulate right-clicks. Can anyone confirm whether or not it is possible to simulate a right-click? Any suggestions?