Convengamos que si es por seguridad, con javascript no es muy seguro. Además la pregunta original decia bloquear el botón izq (asumamos que es el primario), pero sin indicar las circunstancias.
La técnica de una capa haciendo "overlay" con css, me parece sigue siendo más atractiva y no requiere de jQuery
Código HTML:
Ver original<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> /*<![CDATA[*/
html,body{
height: 100%;
margin: 0;
padding: 0;
border: none;
}
#ocultar{
display: none;
position:fixed;
background:#000;
width: 100%;
height: 100%;
opacity: 0.8;
margin: 0;
padding: 0;
border: none;
top:0;
left:0;
z-index: 999;
text-align: center;
padding-top: 200px;
overflow:hidden;
}
#cerrar{
background: red;
color: #FFF;
border: solid red 2px;
border-radius: 5px;
position: absolute;
z-index: 1000;
text-align: center;
width: 100px;
padding: 8px;
top: 40%;
left: 50%;
margin-left: -50px;
cursor: pointer;
}
/*]]>*/
<script type="text/javascript"> //<![CDATA[
function ocultar(){
document.getElementById('ocultar').style.display ="block";
document.oncontextmenu = new Function("return false");
}
function desactivar(){
document.getElementById('hola').disabled = true;
}
//]]>
<div onclick="this.parentNode.style.display ='none';document.oncontextmenu= 'return true';" id="cerrar">mensaje...
<br/><small>cerrar
</small> <input type="text" value="hola" name="hola" id="hola" />
Es crossbrowser
SAludos