Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detecting swipe gesture iOS - Cordova/Phonegap Javascript

I am having trouble successfully detecting a swipe event on a non-native iOS app I'm making.

<div id="video" data-ng-click="adminSelectVideo(video)" ng-repeat="video in videos">

Could anyone help me with a javascript implementation of detecting a left swipe gesture on the following div element 'video'?

Thanks in advance

like image 596
FootsieNG Avatar asked Apr 12 '14 17:04

FootsieNG


1 Answers

I use hammerjs for javascript multitouch gestures. Swipe gesture is one of them

var element = document.getElementById('video');
Hammer(element).on("swipeleft", function() {
    console.log('you swiped left me!');
});
like image 183
jcesarmobile Avatar answered Oct 18 '22 05:10

jcesarmobile