# @behance/intersection-observer-polyfill

> Polifyll for IntersectionObserver API

Latest version **0.0.2** (published 2017-10-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install @behance/intersection-observer-polyfill
pnpm add @behance/intersection-observer-polyfill
yarn add @behance/intersection-observer-polyfill
bun add @behance/intersection-observer-polyfill
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2017-10-06 |
| First published | 2017-10-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 39 |
| Author | Jeremias Menichelli |
| Maintainers | hzoo |
| Keywords | IntersectionObserver, polyfill |

## Links

- npm: https://www.npmjs.com/package/@behance/intersection-observer-polyfill
- Repository: https://github.com/jeremenichelli/intersection-observer-polyfill
- Homepage: https://github.com/jeremenichelli/intersection-observer-polyfill#readme
- Issues: https://github.com/jeremenichelli/intersection-observer-polyfill/issues
- npm.io page: https://npm.io/package/@behance/intersection-observer-polyfill

## Recent versions

- 0.0.2 (latest) — 2017-10-06

## README

## IntersectionObserver Polyfill

The IntersectionObserver API allows the developer to detect the intersection between a DOM elements and a reference element or the viewport.

**_BEWARE! This is still under development and doesn't cover all possible uses. Feel free to contribute!_**

You can see it working in [this sample page][3] built by [Wilson Page][1].

For more insight read [the official WICG draft][2].


### Contributing

Read the draft, fork this repo and help... there's a lot of stuff to do here yet:

- Support **rootMargin** in options
- Add support for intersection ratio under **threshold** option
- Add proper **this** context inside callback exposing **root** and **rootMargin** observer
- Support **root** element different from viewport
- ~~Support **unobserve** method~~
- ~~Support **disconnect** method~~
- Support **takeRecords** method
- Complete properties present in callback's context argument
  - ~~boundingClientRect~~
  - intersectionRect
  - rootBounds
  - ~~target~~
  - ~~time~~
- Support horizontal scrolling detection
- Improve frame rate performance on scroll
- Create sample page for root different for viewport case

### Browser support

This polyfill was tested in:

- **Chrome 49**
- **Chrome Mobile 49**
- **Firefox 45**
- **Safari 9**
- **iOS Safari 9**
- **Microsoft Edge**


[1]: https://github.com/wilsonpage
[2]: https://wicg.github.io/IntersectionObserver/
[3]: https://jeremenichelli.github.io/intersection-observer-polyfill/example

---
_Source: https://npm.io/package/@behance/intersection-observer-polyfill · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
