Skip to main content

IntersectionController

Purpose

Utility controller to wire up other controller actions when an element comes into or leaves the viewport.

Actions

ActionPurpose
--

Targets

TargetPurposeDefault
---

Classes

ClassPurposeDefault
---

Values

ValueTypeDescriptionDefault
thresholdStringThe single number or comma-separated list of thresholds to report intersection at. See IntersectionObserver constructor options for more.0,1

Events

EventWhenDispatched onevent.detail
intersection:appearWhen the observed element enters the viewportthe controller root elementelement: the observed controller root element
intersection:disappearWhen the observed element leaves the viewportthe controller root elementelement: the observed controller root element

Side Effects

Installs an IntersectionObserver to watch the controller element

How to Use