Event delegation with Hammer.js

hammer.js, javascript

Solution

You simply need to inspect the `target` of the Event object that's passed into your handler.

Here's a demo.

Problem

How would I do jQuery-style event delegation with plain JavaScript in Hammer.js? E.g.: ``` Hammer(document).on('tap', '.item', function () { console.log('tapped') }) ``` Is this directly possible or do I have to do the delegation myself?

Original source