# IntersectionObserver wx.createIntersectionObserver(Object component, Object options)

Start from base library version 1.9.3. Please remaining backward compatible.

with Promise style call: Not supported

Mini Program plugin: Support, need to Mini Program base library version no less than 1.9.6

Creates and returns a IntersectionObserver Object instance. In a custom component or a page that contains it, you should use the this.createIntersectionObserver([options]) To replace.

# parameter

# Object component

Custom component instance

# Object options

to make a choice

attribute type Default values Required Introductions Minimum version
thresholds Array.&ltnumber&gt [0] no An array of values containing all thresholds.
initialRatio number 0 no The initial intersection ratio, which triggers a listener callback if the intersection ratio detected when called is not equal to this value and reaches a threshold.
observeAll boolean false no Whether multiple target nodes are observed simultaneously (instead of one), if set to true ,observe of targetSelector Multiple nodes will be selected (Note: Selecting too many nodes at the same time will affect rendering performance) 2.0.0

# Return value

# IntersectionObserver

# sample code

Preview with Developer Tool