Matt Dietsche
Matt Dietsche

Reputation: 608

Disable the 'save image' menu on iPhone with Javascript

Have a photography site that I want to prevent image copying from. How can I disable the save image menu that pops up on an iPhone when you hold down your finger on an image?

Upvotes: 8

Views: 8977

Answers (2)

jhernandis
jhernandis

Reputation: 33

The solution with CSS (-webkit-touch-callout: none;) as @alex tells, works fine with iOS7 Safari. Thanks.

Upvotes: 2

dannywartnaby
dannywartnaby

Reputation: 5542

Try:

document.body.style.webkitTouchCallout='none';

As an aside is it really worth it? Hacks like this do impact user expectations, and your image is on the internet, anyone who wants it can easily get it regardless of whether a context menu has been disabled in the browser they're using.

Upvotes: 12

Related Questions