appear-event
Element appear event.
Install
yarn add appear-event
or npm i appear-event --save
Usage
observe
and unobserve
const observe unobserve = ; const el = ;const eventListenerOptions = ;const intersectionObserverOptions = ; { // element appeared} { // element disappeared} ; // watch for appear and disappear eventel;el;el;el;; // unwatch for appear and disappear event
eventListenerOptions
intersectionObserverOptions
IntersectionObserver Properties
appearEvent
and disappearEvent
detail
appearEvent.detail
and disappearEvent.detail
is an IntersectionObserveEntry
event-listeners
const addAppearListener addDisappearListener removeAppearListener removeDisappearListener = ; const el = ;const eventListenerOptions = ;const intersectionObserverOptions = ; { // element appeared} { // element disappeared} ;;;;
In React
See demo Also see jsx-native-events
FAQ
Q: Does zero area elements appears when they are in the screen?
A: Yes. And if you'd like to tell if the element is a zero area element, use event.detail.boundingClientRect
to get the element dimensions.
Project created by create-n.