Skip to content

Instantly share code, notes, and snippets.

@christophergregory
Created November 13, 2012 21:13
Show Gist options
  • Save christophergregory/4068435 to your computer and use it in GitHub Desktop.
Save christophergregory/4068435 to your computer and use it in GitHub Desktop.
jQuery:waitForImages(selector, callback)
function waitForImages(selector, callback) {
var loaded = 0;
$(selector).load(function()
{
loaded++;
if (loaded == $(selector).length)
{
callback();
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment