Googleブラウザでマウスの右ボタンと解除方法を無効にします.
760 ワード
1.右クリックボックス
document.oncontextmenu=function(e) {
alert(“ ”);
return false;
}
2.右ボタンの操作なしdocument.oncontextmenu=new Function(“return false”);
解除の方法javascript: (function() {
function R(a) {
ona = "on" + a;
if (window.addEventListener) window.addEventListener(a,
function(e) {
for (var n = e.originalTarget; n; n = n.parentNode) n[ona] = null;
},
true);
window[ona] = null;
document[ona] = null;
if (document.body) document.body[ona] = null;
}
R("contextmenu");
R("click");
R("mousedown");
R("mouseup");
R("selectstart");
})()