IntersectionObserverEntry Class

A change of the intersection of a target with the root of an observer (https://w3c.github.io/IntersectionObserver/#intersection-observer-entry).

public sealed class IntersectionObserverEntry

Constructors

NameDescription
IntersectionObserverEntry(IntersectionObserverEntryInit)Creates an entry from its values.

IntersectionObserverEntry(IntersectionObserverEntryInit)

IntersectionObserver.cs

Creates an entry from its values.

public IntersectionObserverEntry(IntersectionObserverEntryInit intersectionObserverEntryInit)

Properties

NameDescription
BoundingClientRectGets the bounding box of the target (see Element.GetBoundingClientRect).
IntersectionRatioGets the ratio of the intersection area to the area of the bounding box of the target.
IntersectionRectGets the part of the bounding box of the target that intersects the root intersection rectangle, after the clipping by its ancestors.
IsIntersectingGets whether the target intersects the root (the edge-adjacent and zero-area intersections included).
IsVisibleGets whether the target is visible (only computed when the observer tracks the visibility).
RootBoundsGets the root intersection rectangle for a same-origin-domain target, else null.
TargetGets the observed element.
TimeGets the time at which the intersection was recorded, relative to the time origin of the global object of the observer.

BoundingClientRect

IntersectionObserver.cs

IntersectionRatio

IntersectionObserver.cs

Gets the ratio of the intersection area to the area of the bounding box of the target.

public double IntersectionRatio { get; }

IntersectionRect

IntersectionObserver.cs

Gets the part of the bounding box of the target that intersects the root intersection rectangle, after the clipping by its ancestors.

public DomRectReadOnly IntersectionRect { get; }

Gets whether the target intersects the root (the edge-adjacent and zero-area intersections included).

public bool IsIntersecting { get; }

Gets whether the target is visible (only computed when the observer tracks the visibility).

public bool IsVisible { get; }

Gets the root intersection rectangle for a same-origin-domain target, else null.

public DomRectReadOnly? RootBounds { get; }

Gets the observed element.

public Element Target { get; }

Gets the time at which the intersection was recorded, relative to the time origin of the global object of the observer.

public double Time { get; }