How to disable "Save Image As" from right click

BroadStreet2727
Tourist
3 0 6

Hello

 

So I'm still setting up my website, which has a lot of high resolution images, so the customers can zoom in and see all the details of the product. My question is how do I go about disabling the "Save Image As" feature from the right click? I do not want to disable right click as a whole but can some one point me to to some coding and hopefully a tutorial on how to implement that into my code to cover the entire website. I fully understand there are work arounds to save images from websites but this would help deter some people.

 

Thanks in advance!

Replies 2 (2)

koravski
Shopify Partner
23 9 8

Hey BroadStreet2727,
So one way is to use a background image instead of image tag.
Another way is to disable right click but only on the image. You will need jQuery:

$("body").on("contextmenu", "img", function(e) {
  return false;
});

 

BroadStreet2727
Tourist
3 0 6

Thanks for the help!