Bloquear botão direito no IE e também no Firefox

2010-05-07 22:11

Com este código é possível bloquear o funcionamento do botão direito do mouse, também conhecido como "Menu de Contexto".

Código testado no Internet Explorer e no Firefox. 

 

 

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>

<head>

<script>

function click() {

if (event.button==2||event.button==3) {

oncontextmenu='return false';

  }

}

document.onmousedown=click

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

</script>

</head>

 

<body>

<pre>

Inativar Botão Direito Também No FireFox

 

 

CODE

 

function click() 

{

if (event.button==2||event.button==3) 

{

oncontextmenu='return false';

}

}

document.onmousedown=click

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

</pre>

</body>

</html>


Related Posts with Thumbnails