IntersectionObserver
@shopify/shop-minis-platform-sdk / components/TrackingPixel/IntersectionObserver
IntersectionObserverProps
Properties
active?
optional
active:boolean
When false the observer will be paused and callbacks will not be invoked. Note that onLeave will still be invoked on unmount if onEnter was previously fired.
children
children:
Element
IntersectionObserver requires exactly one child.
onEnter()?
optional
onEnter: (event
) =>void
Parameters
Parameter | Type |
---|---|
event | IntersectionObserverVisibilityEvent |
Returns
void
onLeave()?
optional
onLeave: (event
) =>void
Parameters
Parameter | Type |
---|---|
event | IntersectionObserverVisibilityEvent |
Returns
void
visibleThreshold?
optional
visibleThreshold:number
Value between 0->1 representing the percentage of the component that should be visible before we start classifying it as visible. Values outside that range will be clamped.
Examples
0 meaning "any amount visible"
0.5 meaning "half visible"
1 meaning "fully visible"
Default
0
IntersectionObserverVisibilityEvent
Properties
occurredAt
occurredAt:
number
IntersectionObserver()
IntersectionObserver(
__namedParameters
):Element
Parameters
Parameter | Type |
---|---|
__namedParameters | IntersectionObserverProps |
Returns
Element