This module contains functions to emit and observe DOM events.
While the browser also has built-in functions to work with events, you will find Unpoly's functions to be very concise and feature-rich.
Most Unpoly features emit events that are prefixed with up:
.
Unpoly's own events are documented in their respective modules, for example:
Event | Module |
---|---|
up:link:follow |
up.link |
up:form:submit |
up.form |
up:layer:open |
up.layer |
up:network:late |
up.network |
Listens to a DOM event
on document
or a given element.
Emits a custom event with the given name and properties.
Emits a custom event with the given name and properties.
Emits a custom event when this element is clicked.
Builds an event with the given type and properties.
Prevents the event from being processed further.
The class of input device used to cause the current event.
Emits an event and returns whether no listener has prevented the default action.
Registers an event listener to be called when the user
presses the Escape
key.
Unbinds an event listener previously bound with up.on()
.
Listens to a DOM event
on document
or a given element.
Listens to an event on document
or a given element.
The event handler is called with the event target as a
jQuery collection.