A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserverEntry/isIntersecting below:

IntersectionObserverEntry: isIntersecting property - Web APIs

IntersectionObserverEntry: isIntersecting property

Baseline Widely available

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.

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.

Value

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).

Examples

In this simple example, an intersection callback is used to update a counter of how many targeted elements are currently intersecting with the intersection root.

function intersectionCallback(entries) {
  entries.forEach((entry) => {
    if (entry.isIntersecting) {
      intersectingCount += 1;
    } else {
      intersectingCount -= 1;
    }
  });
}

To see a more concrete example, take a look at Handling intersection changes.

Specifications Browser compatibility

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4