Javascript Contextmenu

DOM

http://stackoverflow.com/questions/4909167/how-to-add-a-custom-right-click-menu-to-a-webpage
http://www.w3schools.com/tags/att_global_contextmenu.asp
http://www.w3schools.com/jsref/event_oncontextmenu.asp
http://ignitersworld.com/lab/contextMenu.html
http://www.javascripttoolbox.com/lib/contextmenu/
http://blog.teamtreehouse.com/building-html5-context-menus
http://davidwalsh.name/html5-context-menu
http://lab.jakiestfu.com/contextjs/
https://developer.mozilla.org/en-US/docs/Web/Events/contextmenu
http://www.sitepoint.com/building-custom-right-click-context-menu-javascript/

How to disable the contextmenu?

Use JavaScript to intercept the contextmenu event.

document.onmousedown=right where right is the name of a function.

function disablePrintViaRightClick(e) {
    var hasPrint = jQuery('#printPrivilege').val();
    if (hasPrint == "NO") {
        e.preventDefault();
        e.stopPropagation();
        alert("This Page is fully protected");
        return false;
    }
}

$(document).ready(function() {
    jQuery(document).bind("contextmenu", disablePrintViaRightClick);
});

How to implement your own contextmenu that integrate well with the default context menu?

I still need to read the above links.

How to disable certain default context menu option?

I still need to read the above links to see if this is possible.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License