In a recent project, I used similar functionality. To let the zoom functions for zooming work, you just need to make sure that you specify the values ββcorrectly in the view tag, for example.
<meta name=viewport content="width=device-width,user-scalable=yes,initial-scale=1.0, maximum-scale=2.0"/>
The most important values ββare user scalable = yes, as well as the maximum scale, as this must be greater than 1.0 in order to scale.
Additional information about the viewport can be found here: https://developer.mozilla.org/en-US/docs/Mobile/Viewport_meta_tag
For swipe events, you can bind swipeleft and swiperight events to the .on () function in jQuery Mobile.
Here is an example of what your code looks like:
$('#yourElement').on('swipeleft swiperight', function (event) { //swiped to the left if (event.type == "swipeleft") { //do something } //swiped to the right if (event.type == "swiperight") { //do something } });
For more information on jQuery Mobile events, you can check this link (or the m_gol link provided above, since they are basically the same):
http://jquerymobile.com/demos/1.1.1/docs/api/events.html
Using both sets of code above, you can detect swipe events as well as a pinch to enlarge the page.
source share