event delegation in Hammer JS multi-tocuh events not working

403 Views Asked by At

I'm trying to delegate the multi-touch gesture events in hammer.js with jQuery's .on(), but that doesn't seem to be working.

This works:

var main = $('.settings');
var hammerSwipeDown = Hammer(main, {prevent_default: true}).on('swipedown', function(event){
    event.preventDefault();
    alert("swipe down");
});

But this doesn't work:

var main = $('#main');
var hammerSwipeDown = Hammer(main, {prevent_default: true}).on('swipedown', '.settings', function(event){
    event.preventDefault();
    alert("swipe down");
});

How can I get the multi-touch gesture events to delegate with the jQuery version of Hammer.js?

1

There are 1 best solutions below

0
On

For that you should use the jQuery Hammer Plugin.