How do I prevent Right-click to protect photos?

  • 1
  • Question
  • Updated 4 years ago
  • Answered
  • (Edited)
Does Yola have a 'disable/protect right-click' function for members? At least for the Yola Premier Silver paid members? I couldn't find any info... Please help asap. I'm downsizing & copyrighting my photographs for my site at the moment. I hope I don't have to throw my watermark across the middle:o
Photo of MELINDA

MELINDA

  • 19 Posts
  • 1 Reply Like
  • questioning

Posted 7 years ago

  • 1
Photo of Laura Thomas

Laura Thomas, Social Media Coordinator

  • 4536 Posts
  • 211 Reply Likes
Hi Melinda,

We don't have the ability to disable right clicking as a feature, however we can help you to add it to your site.

Below is a cross browser DHTML script that will prevent the default right menu from popping up when the right mouse is clicked on the web page. You can use it to stop visitors to your website from easily saving your web page, viewing its source or taking images off your site when they're using most of the modern browsers.

Just copy the code below into an HTML widget at the top of your page:

<script language=JavaScript>
<!--

var message="Right-click function disabled!";

function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("alert(message);return false")

// -->
</script>


This script works on most browsers, but it's not foolproof. If someone really wants something from your page they can find ways around it, but at least it's a warning to people who want to take your graphics or your code.
Photo of MELINDA

MELINDA

  • 19 Posts
  • 1 Reply Like
Laura, Thank you so very much. I know someone can go around the right click thingy. I've done that my own self, yet when I can't 'save as' on the 1st or 2nd try, then I don't download others stuff for a reference. Worried about my work & knew it's another protective barrier along with reizing, copyrighting within my metadata, plus watermarking my photography. I care so much since I am one of few photographers, nowadays, that started years ago vs buying a cam & opening up shop. I have also completed college classes, announced my C.P.P. candicacy for 2013, plus invested in training, proper equipment, and trial & error BEFORE I even started the business aspect of it. I added a pic & asked if it looked ok downsized to 72ppi. But that comment went missing or I didn't save it. So, I downloaded my own pic by right clicking & loaded it to PS plus Lightroom3 to see if it was safe. It was fine. Anyways, THANKS SO MUCH FOR THE FREE CODE:) I am new to web building & not too interested in becoming any better at it than I have to be for my personal use. I don't know much about codes, css, html, ext. as others on the Yola community seem to know. So, I don't know what to ask, which functions are paid or user created that are supposed to add more within my site, nor do I know what someone means when they say their site won't load , photos missing, & all the other topics I seen in the problems community... it worries me. Then someone nice & more knowledgable on web building ,such as yourself & Gop, comes along to answer with a simple solution that gives me peace of mind. I want to make it perfect before publishing. So, THANK YOU SO VERY MUCH!!!! Yola problems are not as bad as some people make them seem. Specially, towards someone as new as me:)
Photo of Laura Thomas

Laura Thomas, Social Media Coordinator

  • 4536 Posts
  • 211 Reply Likes
It's a pleasure Melinda, I'm so glad I was able to give you some peace of mind and confidence in your website. The photo you posted above is stunning. Please be sure to share your site with us once you are happy with it.

If you want to see your site featured on our blog, please take a few minutes to tell us what you think makes your site stand out and submit it to: support@yola.com.
Photo of Zamir Prod

Zamir Prod

  • 5 Posts
  • 0 Reply Likes
Watermark your work first, then add to your site in div tags.

Like this: First create a DIV tag and give it a "Class" with a name.

Like this: < div class='div name' >< /div >

Next: Use CSS to add in your image. Also make your DIV same size of your image.

Like this:

< style>
div.div name {
float:left;
width:100px;
height:100px;
background-image:url('Add Your Image URL.JPG');
}
< /style >

That would keep users from using "Save Image As" once right clicking. This would not stop them all, but it would stop many. Hope this helps.  :)

(Edited)