Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-1.9.1.min.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
 Try right click!
</body>
</html>
 
$.event.special.rightclick = {
  bindType: "mousedown",
  delegateType: "mousedown",
  handle: function (evt) {
    if (e.button === 2) {
      $(document).one('contextmenu', false);
      
      var handleObj = evt.handleObj;
    
      evt.type = handleObj.origType;
      ret = handleObj.handler.apply(this, arguments);
      event.type = handleObj.type;
      
      return ret;
    }
  }
};
$('body').on('rightclick', function () {
  console.log('HA!');
});
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers