exposure-ts
v1.2.0
Published
<h1 align="center">exposure-ts</h1> <p align="center"><strong>Based on IntersectionObserver API Implementation the exposure track SDK.</strong></p>
Downloads
2
Readme
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: