is-image-loaded-async
v1.0.3
Published
Returns a Promise when one or more images are loaded. < 1 Kb Gziped. Dependencies free.
Downloads
9
Readme
is-image-loaded-async
Return a Promise when one or more images, is loaded. <1KB, for the browser, no dependencies.
Install
At your choice
npm install --save is-image-loaded-async
yarn add is-image-loaded-async
<script src="https://unpkg.com/is-image-loaded-async"></script>
Usage
is-image-loaded-async(/* Node or NodeList*/)
Exemple
var isImageLoadedAsync = require("is-image-loaded-async")
// Multiple image
isImageLoadedAsync(document.querySelectorAll("img"))
.then(v => console.log(v))
.catch(e => console.log(e))
import isImageLoadedAsync from "is-image-loaded-async"
// Single image
isImageLoadedAsync(document.querySelector("img"))
.then(v => console.log(v))
.catch(e => console.log(e))
<script src="https://unpkg.com/is-image-loaded-async"></script>
<script type="text/javascript">
window.isImageLoadedAsync(document.querySelector("img"))
</script>