constructor new Event.Handler
new Event.Handler(element, eventName[, selector], callback)
-
element
(Element
) – The element to listen on. -
eventName
(String
) – An event to listen for. Can be a standard browser event or a custom event. -
selector
(String
) – A CSS selector. If specified, will callcallback
only when it can find an element that matchesselector
somewhere in the ancestor chain between the event's target element and the givenelement
. -
callback
(Function
) – The event handler function. Should expect two arguments: the event object and the element that received the event. (Ifselector
was given, this element will be the one that satisfies the criteria described just above; if not, it will be the one specified in theelement
argument).
Instantiates an Event.Handler
. Will not begin observing until
Event.Handler#start
is called.