Take the 2-minute tour ×

Default keeping tap on the screen (eg. hold tap for 1 second) will show a option of save image / copy. However , I would like to turn off that function for my web app , is it possible? I have tried to replace the event of touchmove to selectall , however it does not work . Thanks for helping.

addEventListener('touchmove', function(e) { e.preventDefault(); }, true);
share|improve this question
Are you certain you're listening to the right event ('touchmove')? If I want to save a image on my iPad, I can't move my finger (much), or the popup won't show. –  Cerbrus Dec 19 '12 at 9:30
For sure the touchmove is not the correct event, therefore I wonder which is the correct event name . –  user782104 Dec 19 '12 at 9:31
Have a look at the different event handlers for touch events. (I'm not sure you can even prevent the "save?" dialog) –  Cerbrus Dec 19 '12 at 9:33

2 Answers 2

up vote 2 down vote accepted

I thought it would be worth mentioning that you can do this with pure CSS. It's probably not a really great idea, because neither IE10 or Opera Mobile support it. But it can be done, and in the future, this would probably be a better way than with JavaScript. Or if you're only talking about iPhones and iPads, this method would work really well. Here's an example on CodePen.

The code is simple:

.notouch {
    pointer-events: none;

Just give the class of notouch to any image that you want to effect.

If you want to do it to every image on the page, do this:

img {
    pointer-events: none;

And I should give an obligatory speech on useability. By doing this you're overriding default functionality that people expect to be there all the time. It makes for a really bad experience for you to turn off something like this, unless you have a really, really good reason to do so. So please, make sure you do.


To get rid of the magnifying glass, use this code:

.notouch {
    pointer-events: none;

With -webkit-user-select set to 'none' you may not even need to turn off pointer events, but I'm not sure about that. I updated the CodePen as well.

share|improve this answer
Thanks, if the pointer events is disable, an mangifer is shown , is there any way to disable it as well? –  user782104 Dec 20 '12 at 3:24
I think I found a way. Updating answer. –  Timothy Miller Dec 21 '12 at 6:04

It could be beneficial to disable not only preventDefault, but other properties as well:

e.cancelBubble = true;
e.returnValue = false;
return false;

Also the event, are you sure it's touchmove ?

share|improve this answer
stopPropagation is IE-only, OP's asking for iPad functionality. –  Cerbrus Dec 19 '12 at 9:35
Sorry , not work for ipad . –  user782104 Dec 20 '12 at 1:32
Yes, work on iPad. Thanks! –  josejuan Jan 29 at 19:31

Your Answer


