开发者

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 me开发者_运维知识库nu that pops up on an iPhone when you hold down your finger on an image?


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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜