There is no built-in oncontextmenu event handler in jQuery, but you can do something like this:
$(document).ready(function(){
$(document)[0].oncontextmenu = function() {return false;}
$(document).mousedown(function(e){
if( e.button == 2 ) {
alert('Right mouse button!');
return false;
} else {
return true;
}
});
});
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.