Created
June 2, 2010 08:43
-
-
Save assertchris/422120 to your computer and use it in GitHub Desktop.
jQuery when method
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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