A helper for bottom position:sticky
, to listen when it is stuck or not.
npm install @schirrel/footer-stick-observable
Have your position:sticky at bottom identified
<style>
.my-sticky-footer {
bottom: 0;
position: sticky;
}
</style>
<footer class="my-sticky-footer"></footer>
Import the observe functions from the lib
import { observe } from '@schirrel/footer-stick-observable'
observe({
selector: ".my-sticky-footer",
callback: ({ isStuck }) => {},
});