Skip to content

schirrel/footer-stick-observable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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