Page 1 of 1

right click block?

Posted: Fri Jul 01, 2011 9:25 am
by devrikcumle
Right-click and copy on my website how do I disable?


Re: edit HTML , CSS Joomla 1.6

Posted: Fri Jul 01, 2011 9:29 am
by Bub-
Hey me too I was interested to know where do I paste my right click disable code? I used to paste it in the header with 1.5 but since loaded the 1.6.4 and I too am waiting for someone to help point out whether I can access html with in the system too or is it only css as I m not too hot with the ftp.

Re: right click block?

Posted: Fri Jul 01, 2011 9:37 am
by Ramshid
Try this

Code: Select all

var message="Sorry, right-click has been disabled";
function clickIE(){if(document.all){(message);return false}}
function clickNS(e){if(document.layers||(document.getElementById&&!document.all)){
if(e.which==2||e.which==3){(message);return false}}}if(document.layers){document.captureEvents(Event.MOUSEDOWN);
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE}document.oncontextmenu=new Function("return false")
or try Anti Right Click module ... ction/5699

Re: right click block?

Posted: Fri Jul 01, 2011 9:45 am
by Tonie
Which is chidishly easy to circumvent. If people want your content, they will know how to get around the right-click disable.

Re: right click block?

Posted: Fri Jul 01, 2011 10:04 am
by devrikcumle
thank you very much.

Re: right click block?

Posted: Sat Jul 02, 2011 4:03 am
by Spheric
Is it unfashionable to post a more complete reply for a newb?

Hello friend, what you want to do is influence the user-browser behavior. Very few ways to do that without Javascript because that's kinda why the guys at Netscape originally dreamed it up. With Javascript, we can actually modify what user behaviors get what action, in other words we can render their "right click" useless.

That's kind of unethical in high webmaster terms: we never take control of the user machine or experience without the user's consent and understanding. In more modern times, we use Javascript to influence DOM behavior and even get really funky, doing database interface with AJAX and stuff, but that's beyond scope at this moment. Just understand that using Javascript to disable user functionality is frowned upon.

AND as other people have told you, sophisticated users will know exactly how to get around this but here's an example of a Javascript that will screw their right-click:

Actually, screw that, just Google "javascript disable right click" and find it but on to another techniques you can use along with this.

If you only are worried about a few images, make a different id selector in CSS for each image and use the image as the background in CSS for that div. Then in code, insert a transparent gif. When they right-click and save, they will get a transparent gif. That usually confuses people and Google Images too.

If you use the Javascript right-click disable plus the CSS-transparent gif trick you have just frustrated most people, the only people you have to worry about now are those who know to look in your CSS and get your image so at this point, just watermark the image.

I bet 95%+ people will not try to do anything with your images with all that. Make sure your web images are low res too. Never give away your full-res images, always optimize.

Good luck my friend!