Socket
Socket
Sign inDemoInstall

images-loaded

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    images-loaded

Wait for images to load using promises


Version published
Weekly downloads
117
increased by44.44%
Maintainers
1
Install size
8.80 kB
Created
Weekly downloads
 

Readme

Source

images-loaded Build Status

Wait for images to load using promises

Install

$ npm install --save images-loaded

Usage

const imagesLoaded = require('images-loaded');

imagesLoaded('.container').then(elements => {
	// images are hot and ready
});

API

imagesLoaded(input [, options])

Returns a Promise when all images are done loading, with or without errors.

input

Type: string Element NodeList

A container or list of elements to watch for loading images.

options

Type: Object

props

Type: string[]
Default: []

Can be passed a list of DOM style camelCase properties to check. For example, backgroundImage, borderImage, etc.

attrs

Type: string[]
Default: []

Can be passed a list of attributes to check, such as poster in a video tag.

Browser Support

If your browser supports Promise then 🎉. Check it at caniuse.com.

License

MIT © Alex Cross

Keywords

FAQs

Last updated on 27 Mar 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc