Description:
This script will prevent the default right menu from popping up when the right mouse is clicked on the web page. Works well in IE4+ and NS4+.
This script will prevent the default right menu from popping up when the right mouse is clicked on the web page. Works well in IE4+ and NS4+.
To use this script, paste the following code in the <body> section of your HTML document.
Disable right click on mouse
Function to handle right click if the browser is IE
<script language="JavaScript"> var message=”Right Click is Disabled”; function ExeForIE() { if (event.button==2) { alert(message); return false; } } </script>
Function to handle right click if the browser is FireFox
<script language=JavaScript> var message=”Right Click is Disabled”; function ExeForFFox(evt) { if (document.layersdocument.getElementById&&!document.all ) { if (evt.which==2evt.which==3) { alert(message); return false; } } } if (document.layers) { document.captureEvents(Event.MOUSEDOWN); document.onmousedown = ExeForFFox; } else if (document.all&&!document.getElementById) { document.onmousedown = ExeForIE; } document.oncontextmenu=new Function(”alert(message);return false”) </script>
Popularity: 1% [?]

November 19th, 2008
admin
Posted in
Tags: 

Wow, found your site on Yahoo!.Happy I finally tried it out. Not sure if its my Chrome browser,but sometimes when I visit your site, the fonts are really small? However, love your post and will check back.See Ya