Interface ViewTriggerConfig

interface ViewTriggerConfig {
    actOn?: Element;
    delay?: number;
    doDelay?: number;
    id?: string;
    once?: boolean;
    oneWay?: boolean;
    root?: null | Element;
    rootMargin?: string;
    target?: ViewTarget;
    threshold?: number | number[];
    undoDelay?: number;
    views?: CommaSeparatedStr<View> | View[];
}

Properties

actOn?: Element

The element to instantiate all actions on this trigger for.

The element on which the Trigger is defined

delay?: number

Delay in milliseconds before doing, undoing or toggling actions.

0
doDelay?: number

Delay in milliseconds before doing actions.

TriggerConfig.delay

id?: string

An ID for the trigger so that it can be looked up by ID. It has to be unique for each element, but you can use the same ID on different elements.

undefined
once?: boolean

If true, the trigger will run at most once. This will result in the run or toggle methods removing all three of run, reverse and toggle when called, so that the actions are done at most once.

false
oneWay?: boolean

If true, then the reverse method of the trigger will do nothing and the toggle method will always do the actions, i.e. will be equivalent to run.

false
root?: null | Element

The root to pass to the ViewWatcher. See also ViewWatcherConfig

ViewWatcher default

rootMargin?: string

The root margin to pass to the ViewWatcher. See also ViewWatcherConfig

It can be either space-separated or comma-separated.

ViewWatcher default

target?: ViewTarget

The target to use for the ViewWatcher. It can be a string offset specification. See OnViewOptions

The element on which the ViewTrigger is defined

threshold?: number | number[]

The threshold to pass to the ViewWatcher. See also ViewWatcherConfig

ViewWatcher default

undoDelay?: number

Delay in milliseconds before undoing actions.

TriggerConfig.delay

The View to use as the trigger. See also OnViewOptions

Actions will be "done" when the view matches the given spec and "undone" otherwise. What the opposite views are depends on the given view. E.g. for "at", opposites are all the other ones; for "above", the opposite ones are "at" and "below"; for "at,above" opposite is "below", etc.

"at"