这里我们用jQuery的e.which点击了哪一个按键
通过一个示例给大家演示:
$('.btn').mousedown(function(e){ if(3 == e.which){ alert('这是右键单击事件'); }else if(1 == e.which){ alert('这是左键单击事件'); } else{ alert('这是中键单击事件'); } })
左键(1)、中键(2)、右键(3)
这里我们用jQuery的e.which点击了哪一个按键
通过一个示例给大家演示:
$('.btn').mousedown(function(e){ if(3 == e.which){ alert('这是右键单击事件'); }else if(1 == e.which){ alert('这是左键单击事件'); } else{ alert('这是中键单击事件'); } })
左键(1)、中键(2)、右键(3)
评论前必须登录!
注册