IntersectionObserverAPI
Types
intersectionObserver
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 viewport.See IntersectionObserver on MDN
typeintersectionObserver= {root:root,rootMargin:string,thresholds:array<float>,}Record fields
Module
There are methods and helpers defined in IntersectionObserver.
intersectionObserverCallback
typeintersectionObserverCallback= (array<intersectionObserverEntry>,intersectionObserver,)=>unitintersectionObserverEntry
This Intersection Observer API interface describes the intersection between the target element and its root container at a specific moment of transition.See IntersectionObserverEntry on MDN
typeintersectionObserverEntry= {time:float,rootBounds:Null.t<WebAPI.DOMAPI.domRectReadOnly>,boundingClientRect:WebAPI.DOMAPI.domRectReadOnly,intersectionRect:WebAPI.DOMAPI.domRectReadOnly,isIntersecting:bool,intersectionRatio:float,target:WebAPI.DOMAPI.element,}Record fields
intersectionObserverInit
typeintersectionObserverInit= {mutableroot?:root,mutablerootMargin?:string,mutablethreshold?:array<float>,}Record fields
root
option<root >
rootMargin
option< string >
threshold
option< array< float > >
root
typeroot