Zoom Zoom / ZoomOut effect for image using JqueryMobile

I need to add the functionality of the Pinch ZoomIn / Out effect to an image using jqueryMobile Plugin, can anyone help?

Thanks,

- Brock

+4
source share
1 answer

This is possible on jQuery Mobile, but you will need to use a third-party implementation called hammer.js .

It supports a large number of gestures, such as:

  • hold
  • click
  • Doubletap
  • drag, dragstart, dragend, dragup, dragdown, dragleft, dragright
  • swipes, swipeup, swipedown, swipeleft, swiperight
  • transform, transformstart, transformend
  • Rotate
  • pinch, pinchin, pinchout
  • touch (gesture detection starts)
  • release (gesture definition is completed)

Example:

$('#test_el').hammer().on("pinchin", ".nested_el", function(event) { console.log(this, event); }); $('#test_el').hammer().on("pinchout", ".nested_el", function(event) { console.log(this, event); }); 

It works with jQuery Mobile, and this is important. But you should think of some other idea, or at least a different idea for Android 2.X devices, because this platform does not support multitouch events.

There are also some other third-party implementations, such as Touchy . Unfortunately, Touchy only supports a pinch.

+5
source

Source: https://habr.com/ru/post/1479586/


All Articles