1

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]
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Poru
  • 8,254
  • 22
  • 65
  • 89

1 Answers1

3

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/

Matt Esch
  • 22,661
  • 8
  • 53
  • 51