My favorites | Sign in
Project Home Downloads Wiki Issues Source
Checkout   Browse   Changes    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Deshabilitar el botón derecho</title>
<script type="text/javascript">

var sMensaje = 'Botón derecho deshabilitado';

function anularBotonDerecho(e) {

if (navigator.appName == 'Netscape'
&& (e.which == 3 || e.which == 2)){
alert(sMensaje);
return false;
} else if (navigator.appName == 'Microsoft Internet Explorer'
&& (event.button == 2)) {
alert(sMensaje);
}
}

document.onmousedown=anularBotonDerecho;
document.oncontextmenu=new Function("return false");

</script>
</head>
<body>
<h1>Deshabilitar bot&oacute;n derecho</h1>
<p>Ale, intenta darle con el bot&oacute;n derecho</p>


<br><br>
<hr>
Art&iacute;culo disponible en: <a href="http://lineadecodigo.com/javascript/deshabilitar-el-boton-derecho/">http://lineadecodigo.com/javascript/deshabilitar-el-boton-derecho/</a><br/>
<a href="http://lineadecodigo.com" title="Linea de Codigo">lineadecodigo.com</a>

</body>
</html>

Change log

r167 by vcuervo on Sep 8, 2009   Diff
Deshabilitar el botón derecho
Go to: 
Project members, sign in to write a code review

Older revisions

All revisions of this file

File info

Size: 1167 bytes, 38 lines
Powered by Google Project Hosting