Preloader

Loadbalanced image preloader, with queue

Functions

Util.preloader

Definition

Name
Util.preloader
Syntax
Void = Util.preloader( Node node, Array files [, JSON options ] );

Description

Loads array of images and makes callback to node.loaded, when loading is done.

Parameters

node
Node node to notify when loading is done
files
Array Array of files to load
options
JSON Optional options for load process
Options
loaded
Callback function name of loaded callback.
loading
Callback function name of loading callback.
waiting
Callback function name of waiting callback.

Returns

Void

Callbacks

node.waiting()
when using several queues, and you are waiting in line
node.loading()
when your queue starts loading
node.loaded(queue)
when you queue is loaded. The returned queue is an array of images loaded.

Examples

var node = u.qs(".scene"); u.preloader(node, ["file.jpg", "file2.jpg", "file3.jpg"]);

Will make callback to node.loaded when all three images are loaded.

Uses

JavaScript
  • new Date()
  • typeof
  • document.createElement
  • new Image()
Manipulator
  • Util.Events.addEvent
  • Util.appendElement
  • Util.addClass
  • Util.removeClass
  • Util.querySelector

Files

Main file

  • u-preloader.js

Segment support files

  • u-preloader-desktop_light.js

Segment dependencies

desktop_edge
u-preloader.js + u-dom.js + u-events.js
desktop_ie11
u-preloader.js + u-dom.js + u-events.js
desktop
u-preloader.js + u-dom.js + u-events.js
desktop_ie10
u-preloader.js + u-dom.js + u-dom-desktop_ie10.js + u-events.js
desktop_ie9
u-preloader.js + u-dom.js + u-dom-desktop_ie10.js + u-events.js
desktop_light
u-preloader.js + u-preloader-desktop_light.js + u-dom.js + u-dom-dekstop_light.js + u-events.js + u-events-desktop_light.js
tablet
u-preloader.js + u-dom.js + u-events.js
tablet_light
u-preloader.js + u-dom.js + u-events.js
smartphone
u-preloader.js + u-dom.js + u-events.js
mobile
not tested
mobile_light
not tested
tv
u-preloader.js + u-preloader-desktop_light.js + u-dom.js + u-dom-dekstop_light.js + u-events.js + u-events-desktop_light.js
seo
not supported