Topic: right click

Does anybody know what is the html coding to block people from RIGHT CLICKING and SAVING IMAGES from website?

Re: right click

Such blocking is implemented via JavaScript.

Re: right click

<body oncontextmenu=’return false’ ondragstart=’return false’ onselectstart =’return false’ onselect=’document.selection.empty()’ oncopy=’document.selection.empty()’ onbeforecopy=’return false’ onmouseup=’document.selection.empty()’>

or

<script LANGUAGE=”JavaScript”>
function click() { if (event.button==2)
{alert(’sorry’); } } document.onmousedown=click
</script>

Re: right click

Do as you like, but I think blocking right click is useless. If they can see the image it is because they have downloaded it already. smile Also, remember that lots of people turn java off when browsing.

5

Re: right click

and if they dont have a way round it theres always good old print screen.

Re: right click

People selling images always have this problem. I think the best solution is to deface the image by placing a transparent copyright symbol right in the middle. I have not seen any other effective method for avoiding unwanted distribution.

Re: right click

water marking is one way...

another way is to create just a transparent image and then use the real image as background=.
this way when they right click they just download the transparent image

8 (edited by Grez 2010-08-15 15:54)

Re: right click

BenInBlack wrote:

this way when they right click they just download the transparent image

And if they use brain, they will have your image in next 10 seconds by looking at source code (not speaking of print screen)  neutral

IMO watermark is only solution  wink

Eraversum - scifi browser-based online webgame

Re: right click

Yeah this is not 100% effective but the average illiterate will be disabled.

<SCRIPT language="JavaScript">

var errormsg="Sorry, right clicking has been disabled...";

function mouseclick(evt) {
if (document.layers) rc = (evt.which==3);
if (document.all) rc = (event.button==2);
if (rc) {
alert(errormsg);
return false;
}
}

if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=mouseclick;

</SCRIPT>

10

Re: right click

But if you use javascript, by disabling javascript they can take images from your website...

11

Re: right click

salsan wrote:

But if you use javascript, by disabling javascript they can take images from your website...

true. If you do not want any images to be stolen, do not upload them on the net.

forum, Art, Architecture

Did you visit the textpattern forum?

Re: right click

<!-- No Right Click Code -->
<script type="text/javascript">
//<![CDATA[
<!--
var closeWin="0"; // Do you want to close window (1 for yes 0 for no)
var alertVis="1"; // Do you want to alert the visitor (1 for yes 0 for no)
var message="INSERT YOUR WINDOW WARNING MESSAGE HERE"; // Your no right click message here
//  Published at: scripts.tropicalpcsolutions.com
function detail(){
          if(alertVis == "1") alert(message);
          if(closeWin == "1") self.close();
          return false;
}
function IE() {
     if (event.button == "2" || event.button == "3"){detail();}
}
function NS(e) {
     if (document.layers || (document.getElementById && !document.all)){
          if (e.which == "2" || e.which == "3"){ detail();}
     }
}
document.onmousedown=IE;document.onmouseup=NS;document.oncontextmenu=new Function("return false");

//-->
//]]>
</script>
<!-- End No Right Click Code -->

Re: right click

Sadly enough, the right click blocker's are now fully pointless, if you're using browsers such as Google Chrome Simple pressing Shit+Ctrl+I will open the browsers Inspect Feature bypassing the whole right click function entirely.

IN Theory, the idea behind the right click protection worked wonders in the old days, but now its come and become useless, and if you're that serious about protecting you're items, don't upload them, and/or get them Copyrighted smile

Re: right click

What about this?
Use right click disabling js code discussed above to disable right click. In case Javascript is disabled, then

<noscript>
<p><strong>Javascript must be enabled to view this page</strong></p>
</noscript>

Re: right click

So easy, thanks to all