I have a table and I am dynamically add the value in each table cell from FireBase. I want to add a "flash" or "blinking" effect everytime that cell changes. So I need to be able to detect when the content of that has changed.
Detect when the inner html of a changes with javascript or jquery
Asked
Active
Viewed 586 times
0
-
1
? Why not just trigger the effect from the code that updates the cell?
– Pointy
Oct 24 '14 at 13:45
-
You need to use something like [MutationObserver](https://developer.mozilla.org/en/docs/Web/API/MutationObserver)/MutationEvents(old browsers)
– Arun P Johny
Oct 24 '14 at 13:46
-
@zhs What does this has to do with AnuglarJs?
– Josep
Oct 24 '14 at 13:48
-
http://stackoverflow.com/questions/20053557/ng-animate-animation-when-model-changes
– Angad
Oct 24 '14 at 14:03
1 Answers
0
For anyone who is still looking and stumbles across this question, I've found the solution here, posted by @Rohan Kumar, which uses the DOMSubtreeModified
Call a Javascript function when a table change content
$("#mytable").bind("DOMSubtreeModified", function() {
alert("Hurrey table changed");
});
AKR
- 1
Asked
Active
Viewed 586 times
0
-
1? Why not just trigger the effect from the code that updates the cell? – Pointy Oct 24 '14 at 13:45
-
You need to use something like [MutationObserver](https://developer.mozilla.org/en/docs/Web/API/MutationObserver)/MutationEvents(old browsers) – Arun P Johny Oct 24 '14 at 13:46
-
@zhs What does this has to do with AnuglarJs? – Josep Oct 24 '14 at 13:48
-
http://stackoverflow.com/questions/20053557/ng-animate-animation-when-model-changes – Angad Oct 24 '14 at 14:03
1 Answers
0
For anyone who is still looking and stumbles across this question, I've found the solution here, posted by @Rohan Kumar, which uses the DOMSubtreeModified
Call a Javascript function when a table change content
$("#mytable").bind("DOMSubtreeModified", function() {
alert("Hurrey table changed");
});

AKR
- 1