ViewportScroller
Defines a scroll position manager. Implemented by BrowserViewportScroller
.
abstract class ViewportScroller {
abstract setOffset(offset: [number, number] | (() => [number, number])): void
abstract getScrollPosition(): [number, number]
abstract scrollToPosition(position: [number, number]): void
abstract scrollToAnchor(anchor: string): void
abstract setHistoryScrollRestoration(scrollRestoration: "auto" | "manual"): void
}
方法
Configures the top offset used when scrolling to an anchor. | |||
参数
返回值
|
Retrieves the current scroll position. |
参数没有参数。 返回值
|
Scrolls to a specified position. | |||
参数
返回值
|
Scrolls to an anchor element. |
Disables automatic scroll restoration provided by the browser. See also window.history.scrollRestoration info. |