Raphaël对象:模拟点击 [英] Raphaël Object: Simulate click

查看:64
本文介绍了Raphaël对象:模拟点击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以模拟Raphaël对象的点击吗?
我已经尝试过了

It it possible to simulate an click on an Raphaël object? I tried already

object.click();  // Error: click is not a function

// or

object.dispatchEvent('click'); // Error: Could not convert JavaScript argument arg 0 [nsIDOMEventTarget.dispatchEvent]


推荐答案

只需使用Element.node访问DOM节点,如文档中所述。然后,您可以像使用任何其他DOM元素一样触发节点上的事件

Just access the DOM node using Element.node as described in the docs. You can then trigger events on the node as you would with any other DOM element

http://jsfiddle.net/UFZXP/

http://lifescaler.com/2008/04/simulating-mouse-clicks-in-javascript/

这篇关于Raphaël对象:模拟点击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆