Skip to content

Instantly share code, notes, and snippets.

@moaazsidat
Last active August 29, 2015 14:02
Show Gist options
  • Save moaazsidat/4c7bd7bc1fa92c2288f0 to your computer and use it in GitHub Desktop.
Save moaazsidat/4c7bd7bc1fa92c2288f0 to your computer and use it in GitHub Desktop.
start = function() {
framer code
}
preloadImages = ["img1.png", "img2.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 images are loaded
start();
}
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment