1.2.0 • Published 2 years ago
exposure-ts v1.2.0
Installation
NPM
npm install exposure-ts --save
Yarn
yarn add exposure-ts
Constructor Options
Name | Type | Default | Description |
---|---|---|---|
root | String | null | MDN |
rootMargin | String | "0px" | MDN |
threshold | Number[] | 0 | MDN |
once | Boolean | false | Open only one exposure |
import { Exposure } from "exposure-ts";
new Exposure({
threshold: 0.5,
one: false,
});
Methods
add(options)
- options
- Type:
Object
- Properties:
el
: Tells the IntersectionObserver a target element to observe.trackData
: The return value used to trigger the visibility callbackcallback
: When the observer fires the visibility trigger callback
- Type: