public this Crafty.addEvent(Object ctx, HTMLElement obj, String event, Function callback)
- Context of the callback or the value of
- Element to add the DOM event to
- Event name to bind to
- Method to execute when triggered
Adds DOM level 3 events to elements. The arguments it accepts are the call
context (the value of
this), the DOM element to attach the event to,
the event name (without
click rather than
finally the callback method.
If no element is passed, the default element will be
Callbacks are passed with event data.