How to disable the right click on image to prevent downloading images on Shopify?
You want to disable right click and image download for your online store on Shopify. It’s very easy. You don’t have to spend money to install an application. You only add the javascript code bellow into your store.
1 2 3 4 5 | $(document).ready(function(){ $("body").on("contextmenu", "img", function(e) { return false; }); }); |
This script don’t allow right click on image. So the visitors can’t save images.
where do i put this code?
thanks
You can put this code into theme.liquid file
where do i put this code?
thanks
You can put this code into theme.liquid file
Where exactly? I am using the Debut theme.
Where exactly in the theme.liquid file? I use the Debut theme.
On your theme.liquid file to open it in the online code editor. In the online code editor, scroll down a bit until you see the closing body tag. Right before the closing tag, paste this code.
Remember put it in script tag 🙂
people can still copy text just not images. is there to completely disable right click? i seen some stores with this function not sure from app or something.
Copied the code into theme.liquid file and (assumed) theme.js as instructed and it worked however, you can see the actual code on my website. What I did was place the code only in theme.js at the very end and it worked perfectly.
Put it at the end of theme.js and worked perfectly. thanks!
you rock
Thank you. I keep coming across apps for this and i just want the code. Thanks!
Worked perfectly on theme.js.liquid file. Thank you so much!
TIP! Put the code at the VERY end of the coding sequence, PAST the original coding. Locked up all four images on my shopify store including an image on my homepage 🙂
Not working on Dawn theme for shopif 2.0, please help