2010-11-30 19 views

答えて

1

あなたのためにこれの多くを処理するプラグインがあります:http://abeautifulsite.net/blog/2008/05/jquery-right-click-plugin/

それとも、独自のロールしたい場合:

はevent.whichのためのドキュメントをチェックアウト:http://api.jquery.com/event.which/

どのマウスボタンがクリックされたかを検出できます。

$('.clicky').mousedown(function(event) { 
switch (event.which) { 
    case 1: 
    alert('Left mouse button pressed'); 
    break; 
    case 2: 
    alert('Middle mouse button pressed'); 
    break; 
    case 3: 
    alert('Right mouse button pressed'); 
     // you would want to prevent default behavior and trigger a click 
     event.preventDefault(); 
     $(this).trigger('click'); 
    break; 
    default: 
    alert('You have a strange mouse'); 
} 
}); 
+0

LOL - amazing - 'alert( 'あなたには奇妙なマウスがあります);' xD –

0

何を試しましたか?これはシンプルな解決法を用いると非常に単純な問題です。

右に接続し、必要に応じてハンドラを書いてください。 :)

関連する問題