A simple utility that returns three reactive boolean variables based on certain scroll positions, to be used in dynamic css classes.
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
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 |