Raphaël Object: Simulate click

早过忘川 提交于 2019-12-02 11:45:35

问题


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]

回答1:


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/



来源:https://stackoverflow.com/questions/9855003/rapha%c3%abl-object-simulate-click

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!