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?
For that you should use the jQuery Hammer Plugin.