Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Image object loading with a clean interface.
JavaScript
branch: gh-pages

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
images
src-test
src
README.markdown
index.html

README.markdown

Load images

Does what it says on the tin; preloads images with a nice, clean API

API

Signature

The signature of the function is:

 function load_images(image_object, callback_function)

Where it can be used like:

var image_object = {
    ninja: "images/ninja.png", 
    person: "images/person.png"
}

function callback_function(images){
    console.log(images)
}

load_images(image_object, callback_function)

The callback is called as soon as all images are loaded, and the above callback would result in this in the console:

{ ninja: HTMLImageElement, person: HTMLImageElement }

Tests

Feel free to run the unit tests

Something went wrong with that request. Please try again.