Question: I'm using [hammer.js](http://eightmedia.github.com/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 but parent's event is also triggered and I don't want that.

```
$('#parent').hammer().bind('tap', function(e) {
    $(this).css('background', 'red');
});​​​​​​​​

$('#child').hammer().bind('tap', function(e) {
    e.stopPropagation();
    $(this).css('background', 'blue');
});

```

Here is an example: <http://jsfiddle.net/Mt9gV/>

​
I also tried with [jGestures](http://jgestures.codeplex.com/) and the issue seems to be the same.
How can I achieve this result with one of those library? (or another one if it is needed)

Answer: 
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');
});

```

​
If you can't get this to work.. just call another method on the tap after verifying the needful (`arguments.callee` is where I would start in such a case) , this would have the added benefits of letting other users hook the button also...

`function myFn(a) { if(a) $(this).css('background', 'red'); else $(this).css('background', 'blue');}`

```
$('#parent').hammer().bind('tap', function(e) {
   //Check arguments.callee or other data in event and call myFn
});​​​​​​​​

$('#children').hammer().bind('tap', function(e) {
  //Same here
});

```