From 85fcbe44fc3a83ddd1fe04fbd9990b7fe2378192 Mon Sep 17 00:00:00 2001 From: Viktor Chernodub <37013688+chernodub@users.noreply.github.com> Date: Thu, 16 Oct 2025 12:25:28 +0300 Subject: [PATCH] Update intersection observer threshold explanation --- files/en-us/web/api/intersection_observer_api/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/en-us/web/api/intersection_observer_api/index.md b/files/en-us/web/api/intersection_observer_api/index.md index 8f90d60b3d44ee1..d1b8bdc6cb2384a 100644 --- a/files/en-us/web/api/intersection_observer_api/index.md +++ b/files/en-us/web/api/intersection_observer_api/index.md @@ -69,7 +69,7 @@ The `options` object passed into the {{domxref("IntersectionObserver.Intersectio The margins are applied to nested scrollable containers before computing intersections. Positive values grow the clipping rectangle of the container, allowing targets to intersect before they becomes visible, while negative values shrink the clipping rectangle. - `threshold` - - : Either a single number or an array of numbers which indicate at what percentage of the target's visibility the observer's callback should be executed. If you only want to detect when visibility passes the 50% mark, you can use a value of 0.5. If you want the callback to run every time visibility passes another 25%, you would specify the array \[0, 0.25, 0.5, 0.75, 1]. The default is 0 (meaning as soon as even one pixel is visible, the callback will be run). A value of 1.0 means that the threshold isn't considered passed until every pixel is visible. + - : Either a single number or an array of numbers which indicate at what percentage of the target's visibility the observer's callback should be executed. If you only want to detect when visibility passes the 50% mark, you can use a value of 0.5. If you want the callback to run every time visibility passes another 25%, you would specify the array \[0, 0.25, 0.5, 0.75, 1]. The default is 0 (meaning the callback will be run as soon as the target element intersects or touches the boundary of the root, even if no pixels are yet visible). A value of 1.0 means that the threshold isn't considered passed until every pixel is visible. - `delay` {{experimental_inline}} - : When tracking target visibility ([trackVisibility](#trackvisibility) is `true`), this can be used to set the minimum delay in milliseconds between notifications from this observer. Limiting the notification rate is desirable because the visibility calculation is computationally intensive.