当前位置: 动力学知识库 > 问答 > 编程问答 >

How to find pinch in or pinch out using Gestures events in IOS safari in jquery?

问题描述:

I want to implement Pinch In and Out functionality for IPAD. I've been using this events listed on http://developer.apple.com/library/IOs/#documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html.

$('div.mainContainer').live("gesturestart", function(e){

alert("start " + e.originalEvent.scale);

});

$('div.mainContainer').live("gesturechange", function(e){

alert("change " + e.originalEvent.scale);

e.preventDefault();

});

The above code works but could not figure out the pinch in/out.

P.S. I've tried jGestures but it does not work at all.

网友答案:

It's seems duplicate of

javascript event for a mobile pinch/zoom action

also look at

http://chillburn.com.au/blog/enabling-the-pinch-zoom-for-the-ipad-iphone-while-using-jquery-mobile/

and

http://developer.apple.com/library/ios/#DOCUMENTATION/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html#//apple_ref/doc/uid/TP40006511-SW8

分享给朋友:
您可能感兴趣的文章:
随机阅读: