Skip to content

Latest commit

 

History

History
33 lines (24 loc) · 673 Bytes

README.md

File metadata and controls

33 lines (24 loc) · 673 Bytes

footer-stick-observable

A helper for bottom position:sticky, to listen 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 }) => {},
});

example