Skip to content

Returns a Promise when one or more images are loaded. < 1 Kb Gziped. Dependencies free.

License

Notifications You must be signed in to change notification settings

Ogromny/is-image-loaded-async

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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>

About

Returns a Promise when one or more images are loaded. < 1 Kb Gziped. Dependencies free.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published