PDA

View Full Version : Please Help Me...



starlightchaos
October 10th, 2002, 21:59
Can you tell me how to do the right click on images script? I dnt know and my website is image based, so I need to know that for protection.

Jan
October 11th, 2002, 01:58
It really only offers maybe 20% protection as there are other means by which people can steal your images. But this is the one I have on some old pages.

<script language="JavaScript">

<!--
// No rightclick script v.2.5
// (c) 1998 barts1000
// barts1000@aol.com
// Don't delete this header!

var message="your nice message here :-).\n\n"; // Message for the alert box
// Don't edit below!

function click(e) {
if (document.all) {
if (event.button == 2) {
alert(message);
return false;
}
}
if (document.layers) {
if (e.which == 3) {
alert(message);
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;
// -->

</script>

aphel aura
October 12th, 2002, 14:29
This one is more foolproof, about 80% success rate.


<SCRIPT LANGUAGE="Javascript">
<!--

var isNS = (navigator.appName == "Netscape") ? 1 : 0;
var EnableRightClick = 0;
if(isNS)
document.PrxOff_captureEvents(Event.MOUSEDOWN||Event.MOUSEUP );
function mischandler(){
if(EnableRightClick==1){ return true; }
else {return false; }
}
function mousehandler(e){
if(EnableRightClick==1){ return true; }
var myevent = (isNS) ? e : event;
var eventbutton = (isNS) ? myevent.which : myevent.button;
if((eventbutton==2)||(eventbutton==3)) return false;
}
function keyhandler(e) {
var myevent = (isNS) ? e : window.event;
if (myevent.keyCode==96)
EnableRightClick = 1;
return;
}
document.oncontextmenu = mischandler;
document.onkeypress = keyhandler;
document.PrxOff_onmousedown = mousehandler;
document.onmouseup = mousehandler;

//-->
</script>

edit: Put this between <head> tags.

meow
October 12th, 2002, 23:15
http://www.jamesshuggins.com/h/web1/how_do_i_stop_downloading.htm