This is very easy to check, which mouse button was pressed using jQuery.
This solution works propertly on IE (tested on 9), Firefox (tested on 4), Chrome. In Opera there doesn't work the middle button
and the browser context menu is showing.
$('#someElement').mousedown(function(e) {
switch (e.which) {
case 1:
alert('Left mouse button pressed');
break;
case 2:
alert('Middle mouse button pressed');
break;
case 3:
alert('Right mouse button pressed');
break;
default:
alert('Unsupported mouse button');
}
});