[英]Have to tap twice to fire event/link with iOS
Why is it that, with regular link tags ( <a>
), you have to tap twice for them to fire with iOS devices? 为什么要使用常规链接标记(
<a>
),您必须点击两次以使其在iOS设备上启动?
For example, I have the following in my code: 例如,我的代码中包含以下内容:
<a href="http://www.google.com" class="link">Google</a>
On iOS, I have to tap that link twice for it to redirect me. 在iOS上,我必须点击两次该链接才能重定向我。
In other cases, I have links that are fired through some jQuery event, which also require you to tap twice to fire the event. 在其他情况下,我有通过某些jQuery事件触发的链接,这也需要您点按两次以触发该事件。
How can I fix this, knowing that this is a large project? 知道这是一个大项目,我该如何解决?
Thanks. 谢谢。
try to add touchend
event with your click like : 尝试添加
touchend
事件,例如:
$('#anchor').on('click touchend', function(e) {
window.location = 'link';
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.