Showing posts with label right click. Show all posts
Showing posts with label right click. Show all posts

Sunday, August 11, 2013

Jquery/JS prevent right click menu in browsers

Using jQuery:
$('div#id_of_div').on("contextmenu",function(evt){
    evt.preventDefault(); return false;
});
Or disable context menu on the whole page:
$(document).on("contextmenu",function(evt){
    evt.preventDefault(); return false;
});