Last active
June 5, 2019 13:32
-
-
Save AndersDJohnson/0cf9d94bbe86eb3f5499 to your computer and use it in GitHub Desktop.
jquery-until: wait for selector match
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
var until = function (selector, time, callback) { | |
var $match = $(selector); | |
if ($match.length) { | |
return callback($match); | |
} | |
setTimeout(function () { | |
until(selector, time, callback); | |
}, time); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment