IntersectionObserver extension type

The IntersectionObserver interface of the Intersection Observer API provides a way to asynchronously observe changes in the intersection of a target element with an ancestor element or with a top-level document's . The ancestor element or viewport is referred to as the root.

When an IntersectionObserver is created, it's configured to watch for given ratios of visibility within the root. The configuration cannot be changed once the IntersectionObserver is created, so a given observer object is only useful for watching for specific changes in degree of visibility; however, you can watch multiple target elements with the same observer.

on
Implemented types
Available extensions

Properties

hashCode int
The hash code for this object.
no setterinherited
root JSObject?
no setter
rootMargin String
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrollMargin String
no setter
thresholds JSArray<JSNumber>
no setter

Methods

disconnect() → void
The IntersectionObserver method disconnect() stops watching all of its target elements for visibility changes.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
observe(Element target) → void
The IntersectionObserver method observe() adds an element to the set of target elements being watched by the IntersectionObserver. One observer has one set of thresholds and one root, but can watch multiple target elements for visibility changes in keeping with those.
takeRecords() JSArray<IntersectionObserverEntry>
The IntersectionObserver method takeRecords() returns an array of IntersectionObserverEntry objects, one for each targeted element which has experienced an intersection change since the last time the intersections were checked, either explicitly through a call to this method or implicitly by an automatic call to the observer's callback.
toString() String
A string representation of this object.
inherited
unobserve(Element target) → void
The IntersectionObserver method unobserve() instructs the IntersectionObserver to stop observing the specified target element.

Operators

operator ==(Object other) bool
The equality operator.
inherited