带有触摸设备的jQuery单击触发器 [英] jQuery click trigger with touch devices
本文介绍了带有触摸设备的jQuery单击触发器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在页面加载时添加一个触发点击,因此具有触发功能:
I want to add a trigger click on page load, so am having a trigger function:
$("li.vjs-menu-item").eq(2).trigger('click');
它在台式机上运行良好,但不适用于Andriod和iPhone等触摸设备.我试图在同一点击事件上添加touchstart:
It's working fine on Desktops, but it doesn't work with touch devices like Andriod and iPhones. I tried to add touchstart on the same click event:
$("li.vjs-menu-item").eq(2).trigger('touchstart click');
但这没有任何意义,所以我想知道触摸事件的等效触发器调用是什么?
But it doesn't make any sense, so I want to know what is the equivalent trigger call for touch events ?
推荐答案
您是否尝试过touchend
事件?
另外,如果这不起作用,您可以通过触发focusout
来尝试解决方法
事件.
Have you tried touchend
event?
Also if that does not work you can try a work around by triggering focusout
event.
这篇关于带有触摸设备的jQuery单击触发器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文