Function applyScroll
- applyScroll(node: HTMLElement, options?: ApplyScroll): ActionReturn<ApplyScroll>
Parameters
- node: HTMLElement
The target scrollable HTML element.
Optional
options: ApplyScrollOptions.
Returns ActionReturn<ApplyScroll>
Lifecycle functions.
- node: HTMLElement
Provides an action to save
scrollTop
/scrollLeft
of an element with scrollbars. This action should be used on the scrollable element and must include writable stores that holds the active store for the currentscrollTop
/scrollLeft
value.You may switch the stores externally and this action will update based on the newly set store. This is useful for instance providing a select box that controls the scrollable container switching between multiple lists of data serializing scroll position between each.