Skip to content

Instantly share code, notes, and snippets.

@mojaray2k
Created September 12, 2013 06:26
Show Gist options
  • Save mojaray2k/6533623 to your computer and use it in GitHub Desktop.
Save mojaray2k/6533623 to your computer and use it in GitHub Desktop.
If you want to give your web application a more native feel, you might want to disable right clicking, when a right click occurs, browsers emit the contextmenu event and as with any other event, you can listen for it, and call the preventDefault(0 method. You can take this a few steps further and even display an entirely custom context menu by u…
$(function)(){
$(document).on('contextmenu', function(e){
e.preventDefault();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment