Skip to content

Instantly share code, notes, and snippets.

@oquirozm
Created March 17, 2018 01:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oquirozm/4507c45f9588a54a76168feb8500111f to your computer and use it in GitHub Desktop.
Save oquirozm/4507c45f9588a54a76168feb8500111f to your computer and use it in GitHub Desktop.
How to wait for an item to appear in the DOM
function try() {
if (!$("#element").size()) {
window.requestAnimationFrame(try);
}else {
$("#element").do_some_stuff();
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment