Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
var fn = function waitLoop() {
// picture is loaded if it has width
var width = document.querySelector("img[src='./theme/images/logos/hostedatisc.png']").naturalWidth;
if (typeof width != "undefined" && width > 0) {
callback(true);
} else {
setTimeout(waitLoop, 1000);
}
}
fn();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment