# joshua-arrival-listener

> adjust whether element reach / leave the edge of viewport. Also can set offset.

Latest version **0.0.11** (published 2017-06-28) · ISC license · 0 weekly downloads

## Install

```sh
npm install joshua-arrival-listener
pnpm add joshua-arrival-listener
yarn add joshua-arrival-listener
bun add joshua-arrival-listener
```

## 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.11 |
| Published | 2017-06-28 |
| First published | 2017-04-21 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Joshua Yang |
| Maintainers | joshuayang |
| Keywords | arrival |

## Links

- npm: https://www.npmjs.com/package/joshua-arrival-listener
- Repository: https://github.com/JoshuaYang/joshua-arrival-listener
- Homepage: https://github.com/JoshuaYang/joshua-arrival-listener#readme
- Issues: https://github.com/JoshuaYang/joshua-arrival-listener/issues
- npm.io page: https://npm.io/package/joshua-arrival-listener

## Recent versions

- 0.0.11 (latest) — 2017-06-28
- 0.0.10 — 2017-04-26
- 0.0.9 — 2017-04-25
- 0.0.8 — 2017-04-25
- 0.0.7 — 2017-04-25
- 0.0.6 — 2017-04-24
- 0.0.5 — 2017-04-24
- 0.0.4 — 2017-04-21
- 0.0.3 — 2017-04-21
- 0.0.2 — 2017-04-21

## README

# ArrivalListener

adjust whether element reach / leave the edge of viewport. Also can set offset.



## **initialize**

```javascript
new ArrivalListener({
  // options
});
```



## **options**

| 参数                      | 类型                               | 默认值             | 描述                                       |
| ----------------------- | -------------------------------- | --------------- | ---------------------------------------- |
| el                      | dom                              | (**necessary**) | element needs to listen to               |
| offsetTopEnterBottom    | number (px / percent) / function | 0               | offset when element's top enter viewport's bottom |
| offsetTopLeaveBottom    | number (px / percent) / function | 0               | offset when element's top leave viewport's bottom |
| offsetBottomReachTop    | number (px / percent) / function | 0               | offset when element's bottom enter / leave viewport's top |
| offsetBottomEnterBottom | number (px / percent) / function | 0               | offset when element's bottom enter viewport's bottom |
| offsetBottomLeaveBottom | number (px / percent) / function | 0               | offset when element's bottom leave viewport's bottom |
| onTopEnterBottom        | function                         | 0               | trigger when element's top enter viewport's bottom |
| onTopLeaveBottom        | function                         | null            | trigger when element's top leave viewport's bottom |
| onBottomEnterTop        | function                         | null            | trigger when element's bottom enter viewport's top |
| onBottomLeaveTop        | function                         | null            | trigger when element's bottom leave viewport's top |
| onBottomEnterBottom     | function                         | null            | trigger when element's bottom enter viewport's bottom |
| onBottomLeaveBottom     | function                         | null            | trigger when element's bottom leave viewport's bottom |

---
_Source: https://npm.io/package/joshua-arrival-listener · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
