/assetmanager-js

AssetManager JS is a robust JavaScript asset manager for images.

Primary LanguageJavaScriptGNU General Public License v3.0GPL-3.0

AssetManager JS Built with Grunt

Build Status Bower version

Warning AssetManager JS is no more maintained. It is advised to use modern technologies, see Preloading responsive images

AssetManager JS is a robust and lightweight JavaScript asset manager for images. For example it can be used to quickly preload a set of images for your HTML5 project.

Installation

Bower

  1. bower install assetmanager-js
  2. Include AssetManager.min.js in your website or application from the bower installation folder

Manual

  1. Download a 1KB Assetmanager.min.js
  2. Include it in your website or application

Usage

Initialize:

var assetManager = new AssetManager();

Queue assets:

assetManager.add('firstAssetId', 'path/to/asset1.file');
assetManager.add('secondAssetId', 'path/to/asset2.file');

Download all assets:

// callbackFunction will be called once all assets have been downloaded
assetManager.downloadAll(callbackFunction);

Retrieve asset:

var firstAssetObject = assetManager.get('firstAssetId');

Example

See example/index.html.

License

GPLv3