https://github.com/schirrel/footer-stick-observable
A helper for bottom position:sticky, to listen when it is stuck or not
https://github.com/schirrel/footer-stick-observable
css intersection-observer intersectionobserver javascript position
Last synced: 6 months ago
JSON representation
A helper for bottom position:sticky, to listen when it is stuck or not
- Host: GitHub
- URL: https://github.com/schirrel/footer-stick-observable
- Owner: schirrel
- Created: 2022-06-10T20:38:51.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-06-22T14:59:32.000Z (about 4 years ago)
- Last Synced: 2026-01-16T19:18:45.957Z (6 months ago)
- Topics: css, intersection-observer, intersectionobserver, javascript, position
- Language: HTML
- Homepage: https://schirrel.dev/footer-stick-observable/
- Size: 11.7 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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
```html
.my-sticky-footer {
bottom: 0;
position: sticky;
}
```
Import the observe functions from the lib
- `import { observe } from '@schirrel/footer-stick-observable'`
```js
observe({
selector: ".my-sticky-footer",
callback: ({ isStuck }) => {},
});
```
