Gman
Gman

Reputation: 11

Manual Pinch-Zoom event handling on iOS Safari after event.preventDefault();

I implemented a variation of the swipe event handling provided by http://padilicious.com/code/touchevents/index.html Demo: http://padilicious.com/code/touchevents/basicswipe.html

I changed the code to scroll through a number of images (20 - 200) based on a one finger swipe. In order to achieve this you have to override default events using event.preventDefault();

My problem is that I would like to enable defaults on a two finger swipe or pinch zoom. If that isn't possible, how would I manually capture the pinch zoom gesture to enable zooming?

Thanks, g

Upvotes: 1

Views: 3186

Answers (1)

Jacob T. Nielsen
Jacob T. Nielsen

Reputation: 2978

Details regarding your problem are sparse. But if I understand you correctly then you should be able to change your code so it only calls "event.preventDefault()" if "event.touches.length == 1".

"event.touches.length" will have the value of 2 if multiple fingers are touching the screen.

Upvotes: 1

Related Questions