LoadTrigger allows you to run actions one when the page is loaded.


To use with auto-widgets (HTML API), see registerTrigger for the specification.

  • Arguments: none
  • Additional trigger options: none

Scroll to the given element when the page is loaded:

<div data-lisn-on-load=":scroll-to"></div>

Scroll to 100px above the given element 500ms after the page is loaded:

<div data-lisn-on-load="@scroll-to=0,-100 +delay=500"></div>

Scroll to 100px above the given element 500ms after the page is loaded, and play animations defined on it 500ms later (1000ms after it's loaded):

<div data-lisn-on-load="@scroll-to=0,-100 +delay=500 ;
@animate +delay=1000"
></div>

Hierarchy (View Summary, Expand)

Methods

Constructors

Properties

destroy: () => Promise<void>

Undoes all modifications to the element and returns it to its original state.

You will need to recreate it if you want to enable its functionality again.

disable: () => Promise<void>

Disables the functionality of the widget. What this means is specific to each widget.

enable: () => Promise<void>

Re-enables the functionality of the widget. What this means is specific to each widget.

getActions: () => Action[]

Returns the trigger's actions.

getConfig: () => TriggerConfig

Returns the trigger config.

getElement: () => Element

Returns the element passed to the widget constructor.

isDestroyed: () => boolean

Returns true if the widget is destroyed.

isDisabled: () => boolean

Returns true if the widget is currently disabled.

onDestroy: (handler: WidgetHandler) => void

The given handler will be called when the widget is destroyed.

onDisable: (handler: WidgetHandler) => void

The given handler will be called when the widget is disabled.

onEnable: (handler: WidgetHandler) => void

The given handler will be called when the widget is enabled.

reverse: () => Promise<void>

"Undo"es all the Actions linked to the trigger.

run: () => Promise<void>

"Do"es all the Actions linked to the trigger.

toggle: () => Promise<void>

"Toggle"s all the Actions linked to the trigger.

toggleEnable: () => Promise<void>

Re-enables the widget if disabled, otherwise disables it.

MMNEPVFCICPMFPCPTTAAATR