Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save mildfuzz/5696788 to your computer and use it in GitHub Desktop.

Select an option

Save mildfuzz/5696788 to your computer and use it in GitHub Desktop.
Very Simple Javascript Image Preloader
var verySimplePreloader = function(images){
/*
Simply loads images into cache. Accepts a single URL, or an array of URLs
*/
if(!images instanceof Array)
images = [images];
for (var i = 0; i < images.length; i++){
new Image().src = images[i];
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment