jquery判断点击鼠标左、中、右键事件

 

注:1为鼠标左键、2为鼠标中键、3为鼠标右键
$('#btn').mousedown(function(e){ 
          if(3 == e.which){ 
               alert('右键单击事件'); 
          }else if(1 == e.which){ 
                   alert('左键单击事件'); 
              } 
        })

posted @ 2017-09-11 15:37  lilelile  阅读(1311)  评论(0编辑  收藏  举报