Disable right-clicking, image dragging, pretty much everything, etc.


/ Published in: JavaScript
Save to your folder(s)

Annoy your visitors, fool your friends, fun and party. Please note that this also disables ability to write in form fields.


Copy this code and paste it in your HTML
  1. <SCRIPT LANGUAGE="JavaScript">
  2. <!-- Disable
  3. function disableselect(e){
  4. return false
  5. }
  6.  
  7. function reEnable(){
  8. return true
  9. }
  10.  
  11. //if IE4+
  12. document.onselectstart=new Function ("return false")
  13. document.oncontextmenu=new Function ("return false")
  14. //if NS6
  15. if (window.sidebar){
  16. document.onmousedown=disableselect
  17. document.onclick=reEnable
  18. }
  19. //-->
  20. </script>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.