Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Manually trigger Hammer.JS event?

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?

like image 813
Aaron Yodaiken Avatar asked Jul 16 '26 05:07

Aaron Yodaiken


1 Answers

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.

like image 178
nicosantangelo Avatar answered Jul 18 '26 17:07

nicosantangelo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!