jQuery Code Snippet: disable the context menu with jQuery

jQuery Code Snippet: disable the context menu with jQuery

jQuery Code Snippet: disable the right click menu with jQuery

This small, quick jQuery code snippet shows how to disable the right click menu (or the context menu) with only a few lines of code.

This can be useful when you don’t want visitors to access the default menu when they press the right mouse button. This jQuery code can be used on any website or web application.

$(document).ready(function(){
    $(document).bind("contextmenu", function(e){
        return false;
    });
});

More interesting Webdevelopment code snippets?
Have a look in our Creative-Geeks Webdevelopment category


About the Author

Daan is a Creative-Geek who loves learning and sharing new techniques! Follow him on Twitter to keep up to date with the Creative-Geeks blog and other subjects. Contact him on e-mail : info[at]creative-geeks.com.