Manually trigger Hammer.JS event?

hammer.js, javascript

Solution

Check here

Hammer(myelem).trigger('tap', eventData);

Keep in mind that the docs say:

You shouldn't use this, this is an internally method use by the gestures. Only use it when you know what you're doing! You can read the sourcecode about how to use this.

So, just to be sure I would check the source code on trigger, to see what they are doing.

Problem

How can I 'fire' a HammerJS tap event? For example if I've done this: ``` Hammer(myelem).on('tap', myFunction); ``` is there anything like ``` Hammer(myelem).fire('tap') ``` which will then call myFunction with a fake `ev`?

Original source