I\'m using hammer.js and it appears that I event.stopPropagation()
doesn\'t work with tap event.
If I click on the child, the associated event is triggered
As I couldn't get this work, I used a variable to know if the child event has already been triggered. It works quite well with jGestures (I have not tried with hammer.js)
var childTriggered = false;
$('#child').bind('tapone', function(e) {
$(this).css('background', 'red');
childTriggered = true;
});
$('#parent').bind('tapone', function(e) {
if(childTriggered) {
childTriggered = false;
return;
}
$(this).css('background', 'blue');
});