Skip to content

Instantly share code, notes, and snippets.

@kisin
Created June 20, 2013 12:18
Show Gist options
  • Save kisin/5822252 to your computer and use it in GitHub Desktop.
Save kisin/5822252 to your computer and use it in GitHub Desktop.
image preloader
var nextimage = "/images/some-image.jpg";
$(document).ready(function()
{
window.setTimeout(function()
{
var img = $("<img>").attr("src", nextimage).load(function(){
//all done
});
}, 100);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment