Skip to content

Instantly share code, notes, and snippets.

@ayoungh
Created January 25, 2013 17:51
Show Gist options
  • Save ayoungh/4636460 to your computer and use it in GitHub Desktop.
Save ayoungh/4636460 to your computer and use it in GitHub Desktop.
Preload background images
/* Preload images */
       var images = ['/images/contentbg.jpg','/images/scrollbtn.gif','/images/cross.png','/images/sidebar_top_gradient.jpg','/images/bulletpointdown.gif'],
           image_obj = new Image();
       for (var image=0; image<images.length; image++) {
           image_obj.src = images[image];
       }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment