开发者

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

开发者 https://www.devze.com 2023-03-10 18:35 出处:网络
I implemented a variation of the swipe event handling provided by http://padilicious.com/code/touchevents/index.html

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开发者_StackOverflow中文版 zooming?

Thanks, g


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.

0

精彩评论

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