1.0.2 • Published 6 years ago

polite-asset-loader v1.0.2

Weekly downloads
2
License
GPL-3.0
Repository
github
Last release
6 years ago

Polite Asset Loader

When passed an id, class or any CSS selector this script will add all instances of what is passed to an object. The object will then be looped through and any data-attributes with the key data-src will have it's value copied to the src attribute loading the asset.

How to use

 var pal = require('polite-asset-loader');

Polite loads all elements that share this class:

 pal.load('.class');

Polite loads element with unique id:

 pal.load('#id');

Polite loads the third image tag that is a direct child of body:

 pal.load('body > img:nth-child(3)');
1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago