简体   繁体   English

在YUI 3上模拟触摸事件

[英]Simulating touch event on YUI 3

I want to simulate / fire a touch event (touchstart or touchend) on a link with YUI 3. 我想在与YUI 3的链接上模拟/触发触摸事件(touchstart或touchend)。

The function .simulate doesn't handle the 'touch event', but only click/dblclick etc.... 函数.simulate不处理“触摸事件”,而仅处理click / dblclick等。

When i search in the official doc, there is nothing about it on the event section. 当我在官方文档中搜索时,事件部分没有任何相关内容。

Is there anyway to do this ? 反正有这样做吗?

Thanks 谢谢

I'm not sure you can use touchstart or touch{move,end} on non-touch device. 我不确定您可以在非触摸设备上使用touchstart或touch {move,end}。 Maybe you want to try to fire a 'gesturemovestart', that should be cross-device. 也许您想尝试触发“ gesturemovestart”,它应该是跨设备的。 Y.one.('#yourLink').fire('gesturemovestart') See http://yuilibrary.com/yui/docs/event/touch.html#move Y.one。('#yourLink')。fire('gesturemovestart')参见http://yuilibrary.com/yui/docs/event/touch.html#move

When the link is clicked, I fire 'gesturemovestart': http://jsfiddle.net/DrMw8/ 单击链接后,我会启动“ gesturemovestart”: http : //jsfiddle.net/DrMw8/

Best regards, Ludo 最好的问候,卢多

No, there is no support for simulation of touch events yet. 否,尚不支持模拟触摸事件。 It's documented here: http://yuilibrary.com/yui/docs/event/simulate.html#no-touch-events-yet 在此处进行了记录:http: //yuilibrary.com/yui/docs/event/simulate.html#no-touch-events-yet

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

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