Detecting swipe gesture iOS - Cordova/Phonegap Javascript
Asked Answered
R

1

5

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

Rasp answered 12/4, 2014 at 17:54 Comment(0)
T
11

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!');
});
Tessi answered 14/4, 2014 at 7:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.