HxTrigger

Values for Hx.trigger.

Types

Link copied to clipboard
class Builder

Builder class for Hx.trigger value.

Link copied to clipboard

Determines how events are queued if an event occurs while a request for another event is in flight.

Properties

Link copied to clipboard
const val load: String

"load" - triggered on load (useful for lazy-loading something)

Link copied to clipboard
const val revealed: String

"revealed " - triggered when an element is scrolled into the viewport (also useful for lazy-loading). If you are using overflow in css like overflow-y: scroll you should use intersect once instead of revealed.

Functions

Link copied to clipboard
fun every(duration: Duration, conditional: String? = null): String

By using the syntax every <timing declaration> you can have an element poll periodically.

Link copied to clipboard
fun intersect(root: StandardCssSelector? = null, threshold: Float? = null): String

"intersect" - fires once when an element first intersects the viewport. This supports two additional options.

Link copied to clipboard
operator fun invoke(event: String, block: HxTrigger.Builder.() -> Unit): String

Builds a value for Hx.trigger.