TriggerViewport
Detects when an element reaches the value inside the viewport
Install
$ npm i -S lagden-trigger-viewport
Usage
const d = documentlet p = d trigger: 75 { elclassList if allFired p = null }
API
TriggerViewport
constructor(els, options = {})
Name | Type | Required | Default | Description |
---|---|---|---|---|
els | array | yes | Array of HTML Elements | |
options | object | no | see below | Some options |
options
Name | Type | Required | Default | Description |
---|---|---|---|---|
trigger | int | no | 50 | 0 is top and 100 is bottom (percentage) |
cb | function | no | null | Callback |
License
MIT © Thiago Lagden