How can I trigger some action with right click after disabling the browser context menu ?
I tried this . . .
$(document).ready(function(){ $(document).bind('contextmenu',function(e){ $('.alert').fadeToggle(); return false; }); });
There is no built-in oncontextmenu event handler in jQuery, but you can do something like this:
Basically I cancel the oncontextmenu event of the DOM element to disable the browser context menu, and then I capture the mousedown event with jQuery, and there you can know in the event argument which button has been pressed.
You can try the above example here.