2

Does anyone know the jquery code to perform the action of a left click button when right mouse button is clicked

For Example: Say I right click on a link , instead of opening a pop up window I need it to go the link's destination . In other wants I need the right click to do the action of a mouse left click .

Tried searching the web , but was of no use . Hence posting this as my last option .

Would really appreciate any help .

Thanks in advance .

4

2 に答える 2

0

試す

$('a').on('contextmenu', function(e){
    window.location = this.href;
    return false;
});

デモ

于 2012-11-19T05:35:20.380 に答える
0
$('#element').mousedown(function(event) {
    if (event.which==3) {
        $('#element').trigger('click');
         break;
       }
});
于 2012-11-19T06:20:48.567 に答える