Table of Contents

Class IntersectionObserverEntry

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

The IntersectionObserverEntry interface of the Intersection Observer API describes the intersection between the target element and its root container at a specific moment of transition.

[Value("IntersectionObserverEntry")]
public class IntersectionObserverEntry
Inheritance
IntersectionObserverEntry
Inherited Members

Remarks

Instances of IntersectionObserverEntry are delivered to an IntersectionObserver callback in its entries parameter; otherwise, these objects can only be obtained by calling TakeRecords().

See also on MDN

Constructors

IntersectionObserverEntry()

public IntersectionObserverEntry()

IntersectionObserverEntry(IntersectionObserverEntryInit)

public IntersectionObserverEntry(IntersectionObserverEntryInit intersectionObserverEntryInit)

Parameters

intersectionObserverEntryInit IntersectionObserverEntryInit

Properties

BoundingClientRect

The boundingClientRect read-only property of the IntersectionObserverEntry interface returns a DOMRectReadOnly which in essence describes a rectangle describing the smallest rectangle that contains the entire target element.

[Value("boundingClientRect")]
public DOMRectReadOnly BoundingClientRect { get; }

Property Value

DOMRectReadOnly

A DOMRectReadOnly which describes the smallest rectangle that contains every part of the target element whose intersection change is being described.
This value is obtained using the same algorithm as GetBoundingClientRect(), so refer to that article for details on precisely what is done to obtain this rectangle and what is and is not included within its bounds.In the general case, however, it's safe to think of this as the bounds rectangle of the target element.

Remarks

IntersectionRatio

The intersectionRatio read-only property of the IntersectionObserverEntry interface tells you how much of the target element is currently visible within the root's intersection ratio, as a value between 0.0 and 1.0.

[Value("intersectionRatio")]
public Number IntersectionRatio { get; }

Property Value

Number

A number between 0.0 and 1.0 which indicates how much of the target element is actually visible within the root's intersection rectangle.
More precisely, this value is the ratio of the area of the intersection rectangle (IntersectionRect) to the area of the target's bounds rectangle (BoundingClientRect).If the area of the target's bounds rectangle is zero, the returned value is 1 if IsIntersecting is true or 0 if not.

Remarks

IntersectionRect

The intersectionRect read-only property of the IntersectionObserverEntry interface is a DOMRectReadOnly object which describes the smallest rectangle that contains the entire portion of the target element which is currently visible within the intersection root.

[Value("intersectionRect")]
public DOMRectReadOnly IntersectionRect { get; }

Property Value

DOMRectReadOnly

A DOMRectReadOnly which describes the part of the target element that's currently visible within the root's intersection rectangle.This rectangle is computed by taking the intersection of IntersectionObserverEntry with each of the Target's ancestors' clip rectangles, with the exception of the intersection Root itself.

Remarks

IsIntersecting

The isIntersecting read-only property of the IntersectionObserverEntry interface is a Boolean value which is true if the target element intersects with the intersection observer's root.

[Value("isIntersecting")]
public bool IsIntersecting { get; }

Property Value

bool

A Boolean value which indicates whether the Target element has transitioned into a state of intersection (true) or out of a state of intersection (false).

Remarks

If this is true, then, the IntersectionObserverEntry describes a transition into a state of intersection; if it's false, then you know the transition is from intersecting to not-intersecting.

See also on MDN

IsVisible

[Value("isVisible")]
public bool IsVisible { get; }

Property Value

bool

RootBounds

The rootBounds read-only property of the IntersectionObserverEntry interface is a DOMRectReadOnly corresponding to the Target's root intersection rectangle, offset by the RootMargin if one is specified.

[Value("rootBounds")]
public DOMRectReadOnly? RootBounds { get; }

Property Value

DOMRectReadOnly

A DOMRectReadOnly which describes the root intersection rectangle.
For roots which are the Document's viewport, this rectangle is the bounds rectangle of the entire document.
Otherwise, it's the bounds of the root element.This rectangle is offset by the values in RootMargin.

Remarks

Target

The target read-only property of the IntersectionObserverEntry interface indicates which targeted Element has changed its amount of intersection with the intersection root.

[Value("target")]
public Element Target { get; }

Property Value

Element

The IntersectionObserverEntry's target property specifies which Element previously targeted by calling Observe(Element) experienced a change in intersection with the root.

Remarks

Time

The time read-only property of the IntersectionObserverEntry interface is a Number that indicates the time at which the intersection change occurred relative to the time at which the document was created.

[Value("time")]
public Number Time { get; }

Property Value

Number

A Number which indicates the time at which the Target element experienced the
intersection change described by the IntersectionObserverEntry.
The time is specified in milliseconds since the creation of the containing document.

Remarks