IntersectionObserver: relativeToViewport() method
The relativeToViewport method can be used to specify a LynxView as a reference node, and the reference node's viewport can be scaled according to margins.
grammar
Parameters
margins
Specifies the zoom value of the reference node window. This value only affects the detection of the intersection state and does not affect the actual view display. A positive value means expanding the reference node window boundary, and a negative value means shrinking the reference node window boundary.
return value
Precautions
The intersection state between the target node and the reference node and the target node and the ancestor node is defined as the smallest intersection ratio as follows:
- The intersection ratio between the target node and
LynxView(scaled bymargins) - The intersection ratio between the target node and the ancestor node. The ancestor node includes the nodes on the path from the target node to
LynxView. The ancestor node will be ignored whenoverflow: visibleis set.
Compatibility
LCD tables only load in the browser