ViewportScroller
Defines a scroll position manager. Implemented by BrowserViewportScroller
.
abstract class ViewportScroller {
abstract setOffset(offset: [number, number] | (() => [number, number])): void
abstract getScrollPosition(): [...]
abstract scrollToPosition(position: [number, number]): void
abstract scrollToAnchor(anchor: string): void
abstract setHistoryScrollRestoration(scrollRestoration: "auto" | "manual"): void
}
Provided in
-
'root'
Methods
setOffset() |
---|
Configures the top offset used when scrolling to an anchor. |
getScrollPosition() |
---|
Retrieves the current scroll position. |
ParametersThere are no parameters. Returns
|
scrollToPosition() |
---|
Scrolls to a specified position. |
scrollToAnchor() |
---|
Scrolls to an anchor element. |
setHistoryScrollRestoration() |
---|
Disables automatic scroll restoration provided by the browser. See also window.history.scrollRestoration info. |