Created
July 5, 2022 13:00
-
-
Save jrosell/a222ad69e2cc9d6ac6c46a295eb9c4e1 to your computer and use it in GitHub Desktop.
I currently have a tag that has a single trigger that is activated as many times as attributes need to be managed. I would like to add another tag that should be activated at the end, once the previous attributes have been processed by the initial tag.
This file contains 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
<html><body> | |
<script> | |
function handle() { | |
console.log("handle") | |
window.myPolling = setTimeout(finish, 2000); | |
} | |
function finish() { | |
console.log("finish") | |
} | |
function fireAttribute(){ | |
clearTimeout(window.myPolling); | |
handle() | |
} | |
window.addEventListener('DOMContentLoaded', (event) => { | |
setTimeout(fireAttribute, 1000) | |
setTimeout(fireAttribute, 2000) | |
setTimeout(fireAttribute, 3000) | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment