Skip to content

Instantly share code, notes, and snippets.

@sousk
Created December 24, 2010 09:41
Show Gist options
  • Save sousk/754067 to your computer and use it in GitHub Desktop.
Save sousk/754067 to your computer and use it in GitHub Desktop.
fire event after images loaded
var
starter = $('#base img'),
th = starter.length,
cnt = 0;
starter.one("load",function(){
(++cnt >= th) && run();
})
.each(function(){
if(this.complete) starter.trigger("load");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment