StaticgetRetrieve an existing widget by element and ID.
StaticregisterIf no actions are supplied, nothing is done.
Optionalconfig: ViewTriggerConfigLisnUsageError If the config is invalid.
ReadonlydestroyUndoes 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.
ReadonlydisableDisables the functionality of the widget. What this means is specific to each widget.
ReadonlyenableRe-enables the functionality of the widget. What this means is specific to each widget.
ReadonlygetReturns the trigger's actions.
ReadonlygetReturns the trigger config.
ReadonlygetReturns the element passed to the widget constructor.
ReadonlyisReturns true if the widget is destroyed.
ReadonlyisReturns true if the widget is currently disabled.
ReadonlyonThe given handler will be called when the widget is destroyed.
ReadonlyonThe given handler will be called when the widget is disabled.
ReadonlyonThe given handler will be called when the widget is enabled.
Readonlyreverse"Undo"es all the Actions linked to the trigger.
Readonlyrun"Do"es all the Actions linked to the trigger.
Readonlytoggle"Toggle"s all the Actions linked to the trigger.
ReadonlytoggleRe-enables the widget if disabled, otherwise disables it.
ViewTrigger allows you to run actions when the viewport's scroll position relative to a given target or offset from top/bottom/left/right is one of the matching "views" (at/above/below/left/right), and undo those actions when the viewport's "view" is not matching.
To use with auto-widgets (HTML API), see registerTrigger for the specification.
Arguments (optional): One or more (comma-separated) views. Default is "at".
Additional trigger options (see ViewTriggerConfig):
target: A string element specification for an element (see getReferenceElement) or a ScrollOffsetSpec.root: A string element specification. See getReferenceElement.rootMargin: A string.threshold: A number or list (comma-separated) of numbers.Example
Show the element when it's in the viewport, hide otherwise.
Example
Same as above. "views" is optional and defaults to "at".
Example
As above but using a CSS class instead of data attribute:
Example
Show the element 1000ms after the first time it enters the viewport.
Example
Add class
seenthe first time the element enters the viewport, and play the animations defined on it 1000ms after each time it enters the viewport, reverse the animations as soon as it goes out of view.Example
Add class
seenwhen the viewport is at or below the element (element above viewport), remove it when the viewport is above the element. Element going to the left or right of the viewport will not trigger the action. See getOppositeViews:Example
Add class
clswhen the viewport is above or to the left the element (element below or to the right of the viewport), remove it when the viewport is either at, below or to the right of the element.Example
Hide the element when the viewport is above the next element with class
section, show it when the viewport is below or at the target element.Example
As above, but using
data-lisn-refattribute instead of class selector.Example
Open the Openable widget configured for this element when the viewport is 75% down from the top of the page.
Example
As above but using a custom root, rootMargin and threshold for the ViewWatcher.