Skip to content

Instantly share code, notes, and snippets.

@dhoko
Created January 28, 2014 08:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dhoko/8664111 to your computer and use it in GitHub Desktop.
Save dhoko/8664111 to your computer and use it in GitHub Desktop.
Un bon petit loader d'image quick&dirty. Mais qui évite d'avoir un écran blanc entre chaque page (le background fait la taille de l'écran), dans une webview Android
["../assets/images/background-home.jpg",
"../assets/images/background-form.png.jpg",
"../assets/images/background-jeu-1.jpg",
"../assets/images/background-page2.jpg",
"../assets/images/background-page3.jpg",
"../assets/images/background-page4.jpg",
"../assets/images/background-sorry.jpg",
"../assets/images/tuto.jpg"].forEach(function(item) {
var img = new Image();
img.src = item;
img.addEventListener('load', function(){
console.log('Image is loaded' + item);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment