kalovski

Untitled

Nov 23rd, 2015
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. function mutationObserverCallback(mutations) {
  2. /* Grab the first mutation */
  3. var mutationRecord = mutations[0];
  4. /* If a child node was added,
  5. hide the msg after 2s */
  6. if (mutationRecord.addedNodes[0] !== undefined)
  7. setTimeout(hideMsg, 2000);
  8. }
  9. function hideMsg() {
  10. msg.textContent = '';
  11. msg.style.background = 'none';
  12. }
Add Comment
Please, Sign In to add comment