Skip to content

Instantly share code, notes, and snippets.

@assertchris
Created June 2, 2010 08:43
Show Gist options
  • Save assertchris/422120 to your computer and use it in GitHub Desktop.
Save assertchris/422120 to your computer and use it in GitHub Desktop.
jQuery when method
jQuery.when = function(fn, check, interval, bind)
{
var bind = bind || this,
timer = setInterval(function() {
if (check.apply(bind))
{
clearInterval(timer);
fn.apply(bind);
}
}, (interval || 100));
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment