> For the complete documentation index, see [llms.txt](https://yinglinhan.gitbook.io/framer-x-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://yinglinhan.gitbook.io/framer-x-api/library-ku/scroll/events.md).

# Events

**onScroll(info):** void

当滚动时周期性地调用该事件绑定的函数

```jsx
function onScroll(info) {
  console.log(info.offset, info.velocity)
}

<Scroll onScroll={onScroll} />
```

| <p>info: PanInfo</p><p>这个对象包含了各种x和y的信息:</p> |
| ------------------------------------------- |
| - **point:** 相对于设备或者页面的位置信息                 |
| - **delta：**&#x548C;上一次事件触发时的距离             |
| - **offset:** 与刚开始滚动时鼠标或者手指位置相比的偏移量         |
| - **velocity:** 当前指针的速度                     |

**onScrollStart(info):** void

开始滚动时触发绑定的函数

```jsx
function onScrollStart(info) {
  console.log(info.offset, info.velocity)
}

<Scroll onScrollStart={onScrollStart} />
```

| <p>info: PanInfo</p><p>这个对象包含了各种x和y的信息:</p> |
| ------------------------------------------- |
| - **point:** 相对于设备或者页面的位置信息                 |
| - **delta：**&#x548C;上一次事件触发时的距离             |
| - **offset:** 与刚开始滚动时鼠标或者手指位置相比的偏移量         |
| - **velocity:** 当前指针的速度                     |

**onScrolEnd(info):** void

开始结束时触发绑定的函数

```jsx
function onScrollEndStart(info) {
  console.log(info.offset, info.velocity)
}

<Scroll onScrollEnd={onScrollEnd} />
```

| <p>info: PanInfo</p><p>这个对象包含了各种x和y的信息:</p> |
| ------------------------------------------- |
| - **point:** 相对于设备或者页面的位置信息                 |
| - **delta：**&#x548C;上一次事件触发时的距离             |
| - **offset:** 与刚开始滚动时鼠标或者手指位置相比的偏移量         |
| - **velocity:** 当前指针的速度                     |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://yinglinhan.gitbook.io/framer-x-api/library-ku/scroll/events.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
