Skip to main content

Module intersection_observer

Module intersection_observer 

Source
Expand description

Intersection Observer 幾何交差計算モジュール (W3C Intersection Observer Level 2)

ビューポートまたはルート要素に対するターゲット要素の交差判定、 rootMargin(px / %)の適用、交差面積比率(intersectionRatio)、 およびしきい値(thresholds)に基づくコールバック発火判定を提供する。

Structs§

IntersectionRect
幾何矩形 (x, y, width, height)
IntersectionState
交差判定結果
MarginValue
マージン値 (px または %)
RootMargin
rootMargin 定義 (top, right, bottom, left)

Functions§

compute_intersection
W3C Intersection Observer §3.2 アルゴリズムに基づく交差計算
should_trigger_callback
しきい値(thresholds)遷移判定 前回比率と今回比率の間で thresholds のいずれかを跨いだか、または初回かを判定