@frankhoodbs/header-sticky-scroll
v1.2.11
Published
Simple utility that gives reactive values based on scroll
Downloads
91
Keywords
Readme
Header sticky scroll
A simple utility that returns three reactive boolean variables based on certain scroll positions, to be used in dynamic css classes.
Usage
Import the utility function:
import { cssCustomPropertiesList } from '@frankhoodbs/header-sticky-scroll';
const { pinned, top, bottom } = useReactiveScrollClasses({ userOptions });
To get the tree reactive values that indicate the position relative to the scroller selected
Parameters
| Param Name | Type | Description |
|-----------------|------------------------------|-----------------------------------------------------------|
| scroller
| Ref or Window | The scrollable html element or Window, defaults on window |
| offsetTop
| number | vertical offset in px before element is first unpinned |
| offsetBottom
| number | vertical offset in px before element is first unpinned |