1.0.3 • Published 8 years ago

vanilla-preloader v1.0.3

Weekly downloads
1
License
WTFPL
Repository
-
Last release
8 years ago

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

Download the zip file.

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!');
});

License

WTFPL