I want to implement a function that zoom object when user uses two fingers to scale.
I am trying to use gesturechange
event to implement it, but I found the event fired as long as the fingers number exceed one. I want to stop zoom when user uses too many fingers to operate object (it is hard to get the correct position and scale ratio).
Could I detect the number of fingers when gesturechange
fired? I know touchstart
event has a event.touches.length can get it. But I want to know is the same property in gesturechange
event.
Actually this is possible only on IOSX devices. Android does not expose this information to javascript. For example you have the:
document.ongesturechange=function(e)
{
//e.scale
//fingers=e.touches.length;
};
event, but this will work only on iphone/ipad.
Some jquery libraries like http://jgestures.codeplex.com/ can help simulate gesture events on android.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With