Right Click on Image
Posted: 28 Jun 2021, 10:11
Would it be possible to protect the images, prohibit the right click - copy/save image? And I guess turn off F12 while we are at it?
I know it won't keep everyone from doing it, but it will slow them down. I have someone that keeps stealing my photos, cropping off my watermarks (I put them on the edges so as not to spoil the photo), and then posts them on other sites.
I found this code on the internet :-)
*****
$("body").on("contextmenu",function(e){ return false; }); xxxxxxxxxx. $("body"). ...
$("img").mousedown(function(e){ e.preventDefault() }); xxxxxxxxxx. $("img"). ...
$("#searchresults img").mousedown(function(e){ e.preventDefault() }); xxxxxxxxxx. $("#searchresults img").
******
And this
*****
document.addEventListener("contextmenu", function(e){
if (e.target.nodeName === "IMG") {
e.preventDefault();
}
}, false);
******
Or the likes to only disable the image copy/save?
I know it won't keep everyone from doing it, but it will slow them down. I have someone that keeps stealing my photos, cropping off my watermarks (I put them on the edges so as not to spoil the photo), and then posts them on other sites.
I found this code on the internet :-)
*****
$("body").on("contextmenu",function(e){ return false; }); xxxxxxxxxx. $("body"). ...
$("img").mousedown(function(e){ e.preventDefault() }); xxxxxxxxxx. $("img"). ...
$("#searchresults img").mousedown(function(e){ e.preventDefault() }); xxxxxxxxxx. $("#searchresults img").
******
And this
*****
document.addEventListener("contextmenu", function(e){
if (e.target.nodeName === "IMG") {
e.preventDefault();
}
}, false);
******
Or the likes to only disable the image copy/save?