Smoothly scroll the window to a position or to an element, minus the height of the fixed elements (see useFixedOffset) so that they do not cover it.
useFixedOffset
The returned function accepts:
to
id
customOffset
-20
callback
fallbackTimeout
behavior
scrollTo
@knitkode/dom
The destination is never above the top of the page.
Optional
Do not subtract the fixedOffset from the to positions. When to is an element id we will keep into account the fixedOffset despite this option.
Smoothly scroll the window to a position or to an element, minus the height of the fixed elements (see
useFixedOffset) so that they do not cover it.The returned function accepts:
to: the position (in px from the top of the page) or theidof the element to scroll tocustomOffset: added to the destination (e.g.-20to stop 20px before)callback,fallbackTimeoutandbehavior: seescrollTofrom@knitkode/domThe destination is never above the top of the page.