Thursday, 23 August 2012

How to cancel right click context menu in jQuery

Hi there guys! While I was working in the next tutorial I have been encountered with a problem: How can I block / cancel the context menu when I do right click on the screen?
There are a lot of examples and scripts in javascript, but one more time jQuery makes it easy! Here you have the code:
  1. $(document).ready(function(){  
  2.     $(document).bind("contextmenu",function(e){  
  3.         return false;  
  4.     });  
  5. });  
This code works in: Firefox, Internet Explorer 6 & 7, Opera, Safari & Chrome.

No comments:

Post a Comment