1.0.1 • Published 2 years ago

@schirrel/footer-stick-observable v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

footer-stick-observable

A helper to listen to position:sticky when used for bottom, when it is stuck or not

Install

  • npm install @schirrel/footer-stick-observable

Usage

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 }) => {},
});