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
animConfiganimConfigN-Scroll animation configuration3.6

animConfig

PropertyTypeRequiredDefaultValueDescriptionAPI_LEVEL
anim_ratestringN-Animation curve, optional values linear, easein, easeout, easeinout refer to https://easings.net/3.6
anim_durationnumberN-Animation duration, in milliseconds3.6
anim_fpsnumberN25Animation frame rate3.6
anim_complete_func() => voidN-End of animation callback function3.6

Example

import { scrollTo } from '@zos/page'

scrollTo({
y: -200,
})