Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable 'save image as' option on right click? [duplicate]

I want to prevent users from right-clicking on image on my site and saving them. I know there are many work-around for this, but I still need to do it.

Any help?

Also, this site has this feature - http://finsix.com/dart/#section-colors

It can be html, javascript, jquery. Any solution will do.

like image 501
Grey-lover Avatar asked Jun 03 '14 16:06

Grey-lover


People also ask

How do I disable save image as right click?

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

How do I right click to save an image?

Right click on the image. 3.) Go to 'Save Image As Type 2.0' 4.) Select which file type you would like to save the image (PNG, JPG, PDF, or WebP) Features: 1- Easy To Use.

How do you save a picture on a Mac without right click?

Dragging is the quickest and simplest way to save an image on a Mac, but it offers less control than right clicking, as you can't name the file. 1. Left click and hold on the image to be saved.


2 Answers

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

This is the "new" way in jQuery. Bear in mind anyone with technical knowledge would be able to get around this.

like image 151
ntzm Avatar answered Oct 05 '22 23:10

ntzm


Use the image as a background-image of a div element, This will keep the easy minded people away from saving it ;)

like image 44
alexdd55 Avatar answered Oct 06 '22 01:10

alexdd55