如何“触发”HammerJS 点击事件?例如,如果我这样做了:
Hammer(myelem).on('tap', myFunction);
有没有类似的东西
Hammer(myelem).fire('tap')
然后它将使用伪造的 ev
调用 myFunction?
最佳答案
检查 here
Hammer(myelem).trigger('tap', eventData);
请记住文档说:
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.
所以,为了确定我会 check the source code on trigger ,看看他们在做什么。
关于javascript - 手动触发 Hammer.JS 事件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17606535/