Created
March 23, 2017 05:38
-
-
Save VicVicos/80ae8db90147dfdac00728d411d678bd to your computer and use it in GitHub Desktop.
Observer JavaScript
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 observer = new MutationObserver(function(mutations) { | |
| mutations.forEach(function(mutationRecord) { | |
| // My Function | |
| }); | |
| }); | |
| var target = document.querySelector('.element'); | |
| observer.observe(target, { | |
| childList: true, | |
| subtree: true, | |
| attributes: false, | |
| characterData: false, | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment