Skip to content

Latest commit

 

History

History
16 lines (14 loc) · 384 Bytes

images-complete-listener.md

File metadata and controls

16 lines (14 loc) · 384 Bytes

Images complete listener usage

  • Let's say we have images that we want to animate.
  • So we want to preload all of them before animation starts.
new ImagesCompleteListener({
  images: [
    document.querySelector(`.animation-image`),
    `https://via.placeholder.com/400/300`,
  ],
  onComplete: () => {
    console.log(`All the images are preloaded`)
  },
}).activate()