Function applyScrolltop
- apply
Scrolltop (element, store): ActionReturn<MinimalWritable<number>> Parameters
- element: HTMLElement
The target scrollable HTML element.
- store: MinimalWritable<number>
A minimal writable store that stores the element scrollTop.
Returns ActionReturn<MinimalWritable<number>>
Lifecycle functions.
- element: HTMLElement
Provides an action to save
scrollTop
of an element with a vertical scrollbar. This action should be used on the scrollable element and must include a writable store that holds the active store for the currentscrollTop
value. You may switch the stores externally and this action will set thescrollTop
based on the newly set store. This is useful for instance providing a select box that controls the scrollable container.