hammerjs pan event not working in cordova app

704 views Asked by At

I'm using Hammer.js with the jQuery plugin in a Cordova app. I am also using zepto and zepto touch. The reason for having both (currently) is that I recently used only zepto. But the touch/gestures didn't work on Android. So now I try to move to Hammer.js, event by event. While the Pinch Events are working perfect (while zepto touch is also included as library), I don't get the pan event fired. Maybe there is a zepto swipe event interfering, but I wasn't able to verify this.

Here is my code:

hammerReciever = $('.slide[data-idx="' + imageIdx + '"] img').hammer({recognizers: [ [Hammer.Pinch], [Hammer.Pan, { event: 'pan', direction: Hammer.DIRECTION_ALL, threshold: 20, pointers: 1 }]]}); 
hammerReciever.on('pinchin', $.proxy(this.gestureChangeHammer, this));
hammerReciever.on('pinchout', $.proxy(this.gestureChangeHammer, this));
hammerReciever.on('pan panstart panstop panmove', console.log('panmove'));

I've tried it with treshold of 0 and 10. Also I've tried to use "pan", "pan panmove" and "panmove" in the on function.

Any idea?

0

There are 0 answers