---
name: "IntersectionObserver"
mode: "api"
versionRequirements:
  - { name: "Base Library", version: "2.10.0" }
title: "IntersectionObserver - Object used to infer whether certain nodes are visible to the user and what proportion is visible"
---

## IntersectionObserver

> [VERSION] Base Library >= 2.10.0

### Description

IntersectionObserver object used to determine whether certain nodes are visible to the user and what proportion is visible. Create an instance via [ty.createIntersectionObserver()](/en/miniapp/develop/miniapp/api/tyml/IntersectionObserver/createIntersectionObserver)

### Parameters

None


### Return Value

Type: `IntersectionObserver`

IntersectionObserver instance

#### Methods

| Method | Description |
| --- | --- |
| `relativeTo` | Use a selector to specify a node as one of the reference regions |
| `relativeToViewport` | Specify the page viewport as one of the reference regions |
| `observe` | Specify the target node and start observing intersection changes |
| `disconnect` | Stop observing; the callback will no longer be invoked |

### Examples

```js
Page({
  onReady() {
    var observer = ty.createIntersectionObserver(this);
    console.log('observer', observer)
  },
});
```
