> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rebellapp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# my.pageScrollTo

> Scroll the page to a specified position.

Use this API to scroll the page to a specific position. The `scrollTop` parameter has a higher priority than `selector`.

## Parameters

| Property  | Type     | Required | Description                                                                  |
| --------- | -------- | -------- | ---------------------------------------------------------------------------- |
| scrollTop | Number   | No       | Scroll to target position in px. Must be greater than 0 when jumping to top. |
| duration  | Number   | No       | Duration of scroll animation, in ms (default: 0)                             |
| selector  | String   | No       | Selector. Framework executes `document.querySelector(selector)`.             |
| success   | Function | No       | Callback on success                                                          |
| fail      | Function | No       | Callback on failure                                                          |
| complete  | Function | No       | Callback that always executes                                                |

## Code Example

```javascript theme={null}
// Scroll to top
my.pageScrollTo({
  scrollTop: 0,
  duration: 300
});

// Scroll to element
my.pageScrollTo({
  selector: '#target-element'
});
```

## Related APIs

<CardGroup cols={2}>
  <Card title="my.createSelectorQuery" icon="crosshairs" href="/jsapi/ui/selector-query/my.createSelectorQuery">
    Query DOM elements
  </Card>
</CardGroup>
