BoltWire

Innovative Ideas :: Radical Results!

INFORMATION

DOCUMENTATION

SOLUTIONS

Stop Mouse

Solutions > Javascript Tricks > Stop Mouse

Summary: Javascript for blocking the right mouse button.
Status: Stable.
Maintainer: Caveman.
Downloads: None.

Here is a simple script for disabling the right mouse click. Try it here on this page.

Here's the script. Cut and paste this to code.embed.stopmouse and then put <embed stopmouse> on any page you want to protect.

<code>
<script language="JavaScript">
<!>>
document.onmousedown = checkClick
if (document.layers){
     document.captureEvents(Event.MOUSEDOWN)
     }

function checkClick(ev) {
     if (navigator.appName == "Netscape"){
          if (ev.which != 1) {
               alert("Right click has been disabled.")
               return false
               }     
          }
     else{
          if (event.button != 1){
               alert("Right click has been disabled.")   
               return false
               }
          }
     }
>>>
</script>
</code>

Copyright © 2013, all rights reserved.