jQuery:绑定鼠标右击事件 Bind event to right mouse click

$(document).ready(function(){ 
  document.oncontextmenu = function() {return false;};

  $(document).mousedown(function(e){ 
    if( e.button == 2 ) { 
      alert('Right mouse button!'); 
      return false; 
    } 
    return true; 
  }); 
});

 

本文:jQuery:绑定鼠标右击事件 Bind event to right mouse click

Leave a Reply