Stickybits is a lightweight alternative to
position: sticky polyfills that works perfectly for things like sticky headers.
- it can add a CSS Sticky Class (
.js-is-sticky) when position: sticky elements become active and a CSS Stuck Class (
.js-is-stuck) when they become stuck.
- it loosely mimics position: sticky to consistently stick elements vertically across multiple platforms
- does not have the jumpiness that plugins that are built around
position: fixedhave because it tries to support
- in its simplest use case, a
scrollevent listener will not be used if
position: stickyis supported.
- it is super simple & lightweight