jquery 判断用户是鼠标是右击还是左击,
// 1 = 鼠标左键 left; 2 = 鼠标中键; 3 = 鼠标右键
$(document).mousedown(function(e) { if(3 == e.which){ alert(‘这 是右键单击事件‘); }else if(1 == e.which){ alert(‘这 是左键单击事件‘); } });
2022-09-03 09:15:54
// 1 = 鼠标左键 left; 2 = 鼠标中键; 3 = 鼠标右键
$(document).mousedown(function(e) { if(3 == e.which){ alert(‘这 是右键单击事件‘); }else if(1 == e.which){ alert(‘这 是左键单击事件‘); } });