可能重复:
How to distinguish between left and right mouse click with jQuery?
右键单击我想要转到另一个页面..使用jquery,该怎么做?任何的想法?
感谢 -
答案 0 :(得分:0)
这样的事情:
HTML
<a id="test" href=#">Click me</a>
JQuery的
$(document).ready(function() {
$("#test").mousedown(function(e) {
switch (e.which) {
case 1:
alert("Left click... boring!");
break;
case 3:
alert("Right-click... off to new page...");
window.top.location = "http://www.google.com/";
break;
}
})
});
JSFiddle here