Skip to main content
Version: v3

scrollTo

Start from API_LEVEL 2.0 . Please refer to API_LEVEL.

Scroll the page to the specified position.

Type

function scrollTo(option: Option): void

Simplified calling method

function scrollTo(y: number): void

Parameters

Option

PropertyTypeRequiredDefaultValueDescriptionAPI_LEVEL
ynumberY-The vertical axis coordinates of the page, the 12 o'clock direction of the watch is positive, and scrolling down is negative2.0

Example

import { scrollTo } from '@zos/page'

scrollTo({
y: -200,
})