Skip to content
Alexey Kupriyanenko edited this page Nov 12, 2013 · 9 revisions

.on(event[, selector], handler)

event One or more space-separated event types and optional namespaces, such as click or keydown.myPlugin keyup.

selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element.

handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false.

Attach an event handler function for one or more events to the selected elements.

.one(event[, selector], handler)

event One or more space-separated event types and optional namespaces, such as click or keydown.myPlugin.

selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element.

handler A function to execute when the event is triggered.

Attach a handler to an event for the elements. The handler is executed at most once per element per event type.

.off(event[, handler])

event One or more space-separated event types and optional namespaces, or just namespaces, such as click, keydown.myPlugin, or .myPlugin.

handler A handler function previously attached for the event(s).

Remove an event handler.

.trigger(event)

event One or more space-separated event types and optional namespaces, such as click or submit.

Execute all handlers and behaviors attached to the matched elements for the given event type.