2010-04-15 90 views

回答

4

您可以評估event.which屬性以確定哪個按鈕已被按下。

$("#test_img").mouseup(function(e) { 
    // e.which is 1, 2 or 3 for left/middle/right mouse button 
    if (e.which === 1) { 
    //continue 
    } 
}); 

此外,要安全檢測鼠標按鈕,您不能使用click -event!改爲使用mousedownmouseup

Try it out here!

+0

謝謝你,這麼詳細的評論。 – Kirzilla 2010-04-15 11:57:34