简体   繁体   English

meteorJS +移动设备上的鼠标/触摸事件-如何最好地监听事件?

[英]meteorJS + mouse/touch events on mobile - how best to listen for events?

What is the best event to respond to for simple clicks on mobile web apps? 对于移动Web应用程序的简单点击,响应的最佳事件是什么?

mousedown doesn't work for ios, and neither did touchstart for me. mousedown对ios不起作用,touchstart对我也不起作用。 (and neither now does a 'click' event it seems wtf?) android has no problems. (而且现在看来wtf都没有'click'事件?)android没有问题。 I'm testing in apple's simulator hopefully it simulates these properly, but it just blinks at me with nothing in the attached console (via safari) 我希望在Apple的模拟器中进行测试,希望它可以正确模拟它们,但是它只是对我眨了眨眼,但连接的控制台中没有任何东西(通过Safari)

so according to this: https://github.com/meteor/meteor/tree/6320acabc46bd6832d2f6db943b69a0634d6b6f9/packages/fastclick 所以根据这个: https : //github.com/meteor/meteor/tree/6320acabc46bd6832d2f6db943b69b063a0634d6b6f9/packages/fastclick

If you would like to use Fastclick for mobile web as well, add it to your app directly with meteor add fastclick. 如果您也想在移动网络上使用Fastclick,请直接使用meteor add fastclick将它添加到您的应用程序中。

which I've done. 我已经做了。 And it should do the setup for me attaching to body etc. 它应该为我安装到身体等上进行设置

However I don't get any response on a click event (oh, sometimes. maybe the ios simulator is buggy?) 但是,我对点击事件没有任何响应(哦,有时。也许ios模拟器有问题?)

Is fastclick better than hammer or other solutions? fastclick是否比锤子或其他解决方案更好?

Do i need to attach the events myself with jquery or should they just "work better" as default meteor 'click' events without the ugly delay? 我是否需要自己将事件附加到jquery上,还是将它们作为默认的“流星”单击事件“更好地工作”而不会造成难看的延迟?

It's surprising this isn't more clear for meteor + mobile, but I can't see anything in the docs on it. 令人惊讶的是,对于流星+移动这还不清楚,但是我在文档中看不到任何东西

I personally love fastclick. 我个人喜欢fastclick。 It works straight out of the box with the regular 'click' event. 它与常规的“ click”事件直接配合使用。 just add the package 只需添加包

meteor add fastclick

and your click events will no longer have lag! 您的点击事件将不再滞后!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM