not-only-code / PreloadJS

PreloadJS makes preloading assets & getting aggregate progress events easier in JavaScript. It uses XHR2 when available, and falls back to tag-based loading when not.

Home Page:http://createjs.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PreloadJS

PreloadJS is a library to make working with asset preloading easier. It provides a consistent API for loading different file types, automatic detection of XHR (XMLHttpRequest) availability with a fallback to tag-base loading, composite progress events, and a plugin model to assist with preloading in other libraries such as SoundJS.

Example

var preload = new createjs.LoadQueue();
preload.addEventListener("fileload", handleFileComplete);
preload.loadFile('http://createjs.com/images/404/gBot-confused.jpg');
function handleFileComplete(event) {
	document.body.appendChild(event.result);
}

Support and Resources

Built by gskinner.com, and is released for free under the MIT license, which means you can use it for almost any purpose (including commercial projects). We appreciate credit where possible, but it is not a requirement.

Classes

LoadQueue The main class that manages all preloading. Instantiate a LoadQueue instance, load a file or manifest, and track progress and complete events. Check out the docs for more information.

About

PreloadJS makes preloading assets & getting aggregate progress events easier in JavaScript. It uses XHR2 when available, and falls back to tag-based loading when not.

http://createjs.com/

License:MIT License


Languages

Language:JavaScript 90.0%Language:CSS 6.8%Language:Handlebars 3.2%