shared
utils
string
object
is
extension
js
tracking
string
dom
when
selection
position
iframe
event
scroll
console
node
string
project
fs
console
whenVisible
Type:Function
Status:stable
Since:1.0.0
Platform:js
@blackbyte.sugar.js.dom.when
Monitor an HTMLElement to be notified when it is visible
Params
- $elm*-HTMLElement
The element to monitor
Return
- -(Promise<HTMLElement>)
The promise that will be resolved when the element is visible
Example
import { whenVisible } from '@blackbyte/sugar/dom'
whenVisible(myCoolHTMLElement).then(($elm) => {
// do something with your element that is now visible
});Todo
- testsnormal
Author
- Olivier Bosselolivier.bossel@gmail.comhttps://blackbyte.space