This repository was archived by the owner on Oct 28, 2020. It is now read-only.

Description
Requested Update
Support "stickyBitStickyOffset" (and potentially other props) as a function, so it is recalculated dynamically.
Why Is This Update Needed?
To support use cases when sticky element position may change due to changes on the page.
For example, going through a responsive breakpoint makes the base font size smaller/larger, which affects the height of an element above the sticky one.
Below is example from my implementation with jQuery.
const $adminBar = $('#wpadminbar');
const $header = $('#masthead');
$header.sticky({
useStickyClasses: true,
stickyBitStickyOffset: () =>
- $header.children('.site-branding').outerHeight()
+ ($adminBar.length ? $adminBar.outerHeight() : 0)
});
In my particular case, the height of the .site-branding changes dynamically when going through responsive breakpoints.
Are There Examples Of This Requested Update Elsewhere?
I am not sure, does not seem so.