hide browser context menu -jquery

Hide the web browser context menu with jquery

Sometimes we need to prevent the context menu from the browser when user right clicks on the element . for example preventing the user from saving image from application,viewing the source code of the web page.
it is very simple to do that using jquery with “contextmenu” event

jQuery().ready(function(){
jQuery('img').bind('contextmenu',function(){return false;});
});

In the above example we disabled context menu on the images by saving. we can see this demo on my previous post about the jquery mouse gestures.

This entry was posted in jquery.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">