README
Vanilla Preloader
Simple Vanilla JavaScript to help you preload your images.
Installation
NPM
npm install vanilla-preloader --save
Bower
bower install vanilla-preloader --save
Old School
Usage
Browserify + ES2015
import VanillaPreloader from 'vanilla-preloader'
new VanillaPreloader([
'https://example.com/path/to/image.jpg',
'https://example.com/path/to/image.jpg',
'https://example.com/path/to/image.jpg',
'https://example.com/path/to/image.jpg',
'https://example.com/path/to/image.jpg',
'https://example.com/path/to/image.jpg',
], function (images) {
console.log('Every image is now loaded!')
})
Browserify + ES5
var VanillaPreloader = require('vanilla-preloader');
new VanillaPreloader([
'https://example.com/path/to/image.jpg',
'https://example.com/path/to/image.jpg',
'https://example.com/path/to/image.jpg',
'https://example.com/path/to/image.jpg',
'https://example.com/path/to/image.jpg',
'https://example.com/path/to/image.jpg',
], function (images) {
console.log('Every image is now loaded!');
});
Old School
new VanillaPreloader([
'https://example.com/path/to/image.jpg',
'https://example.com/path/to/image.jpg',
'https://example.com/path/to/image.jpg',
'https://example.com/path/to/image.jpg',
'https://example.com/path/to/image.jpg',
'https://example.com/path/to/image.jpg',
], function (images) {
console.log('Every image is now loaded!');
});