Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/traum-ferienwohnungen/exit-intent
https://github.com/traum-ferienwohnungen/exit-intent
Last synced: 3 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/traum-ferienwohnungen/exit-intent
- Owner: traum-ferienwohnungen
- License: gpl-3.0
- Created: 2019-05-15T08:16:29.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-03T22:17:59.000Z (almost 2 years ago)
- Last Synced: 2024-03-26T19:36:30.477Z (8 months ago)
- Language: JavaScript
- Size: 428 KB
- Stars: 0
- Watchers: 9
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
Exit Intent detection library.
## Usage
```js
import ExitIntent from '@traum-ferienwohnungen/exit-intent'// Initialise
const exitIntent = new ExitIntent({
threshold: 50,
maxDisplays: 2,
eventThrottle: 100,
onExitIntent: () => {
console.log('exit-intent triggered')
}
});// Destroy
exitIntent.removeEvents();
```### Options
`threshold` (default 20)
maximum distance in pixels from the top of the page to trigger.`maxDisplays` (default 1)
maximum number of times to trigger.`eventThrottle` (default 200)
event throttle in milliseconds.`onExitIntent` (default no-op function)
function to call when an exit intent has been detected.### License
originally based on https://github.com/danhayden/exit-intent