简体   繁体   English

在iOS中的Safario上启用快速多次点击

[英]Enabling rapid, multiple taps on Safario in iOS

I'm using the Fastclick.js library to get rid of the 300ms delay in iOS Safari when pressing buttons and links. 我正在使用Fastclick.js库来消除按下按钮和链接时iOS Safari中300ms的延迟。 It definitely removes the delay for one-off clicks, but I have an application where a user has to rapidly tap a button in the browser, and the button needs to click each time and run a script. 它绝对消除了一次性单击的延迟,但是我有一个应用程序,用户必须在浏览器中快速点击一个按钮,并且该按钮需要每次单击并运行脚本。 The button doesn't seem to register multiple quick taps in a row, only the first one. 该按钮似乎并没有连续注册多个快速点击,而只是第一个。 I'm guessing this is because the system interprets the second tap as the end of a double tap. 我猜这是因为系统将第二个抽头解释为双击的结尾。 Is there any way to deal with this situation? 有什么办法应对这种情况? I don't have this issue on Android. 我在Android上没有这个问题。

I found a solution! 我找到了解决方案! The concepts and (almost) complete code are provided here: 这里提供了概念和(几乎)完整的代码:

https://developers.google.com/mobile/articles/fast_buttons https://developers.google.com/mobile/articles/fast_buttons

And then these guys took that code and put it into a nice javascript and jquery package: 然后这些家伙将代码带入一个不错的javascript和jquery包中:

https://github.com/msbit/google-fastbutton https://github.com/msbit/google-fastbutton

You can even get it with bower install google-fastbutton . 您甚至可以通过bower install google-fastbutton获得它。

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

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