Skip to content

Instantly share code, notes, and snippets.

@ryanhanwu
Created August 28, 2012 05:03
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 ryanhanwu/3495096 to your computer and use it in GitHub Desktop.
Save ryanhanwu/3495096 to your computer and use it in GitHub Desktop.
image preloader (do after all loaded)
var images = [ /* you get it by now */ ];
for (i=0,z=images.length;i<z;i++) {
$('<img />')
.attr('src', images[i])
.load(function(){
$('.profile').append( $(this) );
// Your other custom code
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment