An open API service indexing awesome lists of open source software.

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

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

![example](https://user-images.githubusercontent.com/6757777/173401241-0de38791-f1ca-4492-8424-ddb010a86473.gif)