Advertisement
shotforthesky

Right click disabled

Nov 22nd, 2012
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. BEFORE </body> TAG:
  2. <script language=JavaScript>
  3. <!--
  4.  
  5. //Disable right mouse click Script
  6. //By Maximus (maximus@nsimail.com) w/ mods by DynamicDrive
  7. //For full source code, visit http://www.dynamicdrive.com
  8.  
  9. var message="Function Disabled!";
  10.  
  11. ///////////////////////////////////
  12. function clickIE4(){
  13. if (event.button==2){
  14. alert(message);
  15. return false;
  16. }
  17. }
  18.  
  19. function clickNS4(e){
  20. if (document.layers||document.getElementById&&!document.all){
  21. if (e.which==2||e.which==3){
  22. alert(message);
  23. return false;
  24. }
  25. }
  26. }
  27.  
  28. if (document.layers){
  29. document.captureEvents(Event.MOUSEDOWN);
  30. document.onmousedown=clickNS4;
  31. }
  32. else if (document.all&&!document.getElementById){
  33. document.onmousedown=clickIE4;
  34. }
  35.  
  36. document.oncontextmenu=new Function("alert(message);return false")
  37.  
  38. // -->
  39. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement