简体   繁体   中英

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?

mousedown doesn't work for ios, and neither did touchstart for me. (and neither now does a 'click' event it seems wtf?) android has no problems. 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)

so according to this: https://github.com/meteor/meteor/tree/6320acabc46bd6832d2f6db943b69a0634d6b6f9/packages/fastclick

If you would like to use Fastclick for mobile web as well, add it to your app directly with 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?)

Is fastclick better than hammer or other solutions?

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?

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. It works straight out of the box with the regular 'click' event. just add the package

meteor add fastclick

and your click events will no longer have lag!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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