Monday, October 13, 2008

Disable Right Click

I was rummaging through Photography Portfolio Websites and found a site build by a girl who disabled the right click function instead of ruining her beautiful photography with horrible watermarks. Watermarks are super easy to get rid of anyways using the stamp tool in Photoshop or Fireworks. 

Apparently you can't just paste javascript code for individuals to copy and paste in this box. I'm working on a way to figure this out...

OK, so copy the code below. After you paste it, type in the left carat character (<) before the word SCRIPT and type in the right carat character (>) after language=JavaScript. 

Finally, at the end of the code, type in < / script > with no spaces in between the characters.

SCRIPT language=JavaScript

 var message = "function disabled"; 
 function rtclickcheck(keyp){ if (navigator.appName == "Netscape" && keyp.which == 3){ alert(message); return false; } 
 if (navigator.appVersion.indexOf("MSIE") != -1 && event.button == 2) { alert(message); return false; } } 
 document.onmousedown = rtclickcheck;

I got this code from searching google with "disable right click tutorial". I found this website, which is where I found the code. The website is also an example of the code in use...go ahead, try to right click on this site: http://www.angelfire.com/fl5/html-tutorial/rclick.htm

No comments: