Advertisement
rdsedmundo

button left and right blocker

Sep 8th, 2011
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function right(mousebutton)
  2. {
  3. var msg1 = "Olhe mas não toque!!";
  4. var msg2 = "Seja Criativo!";
  5. if (navigator.appName == 'Netscape' && mousebutton.which==3)
  6. {
  7. alert(msg1);
  8. return false;
  9. }
  10. else
  11. if (navigator.appName == 'Netscape' && mousebutton.which==1)
  12. {
  13. alert(msg2);
  14. return false;
  15. }
  16. else
  17. if (navigator.appName == 'Microsoft Internet Explorer' && event.button == 1)
  18. {
  19. alert(msg1);
  20. return false;
  21. }
  22. else
  23. if (navigator.appName == 'Microsoft Internet Explorer' && event.button == 2)
  24. {
  25. alert(msg2);
  26. return false;
  27. }
  28. return true;
  29. }
  30. document.onmousedown = right;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement