Skip to content

Instantly share code, notes, and snippets.

@koenbok
Created June 4, 2014 08:01
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save koenbok/f9392438027828b4130f to your computer and use it in GitHub Desktop.
Save koenbok/f9392438027828b4130f to your computer and use it in GitHub Desktop.
start = function() {
all my framer code
}
preloadImages = ["a.png", "b.png"];
preloadImagesCount = 0; // How many images were loaded
preloadImages.map(function(image) {
var imageLayer = new Layer({image:image})
imageLayer.on("load", function() {
preloadImagesCount++; // Add one to loaded images
if (preloadImagesCount == preloadImages.length) {
// Run Framer code if all are loaded
start();
}
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment