Skip to content

Commit

Permalink
Update custom.js
Browse files Browse the repository at this point in the history
  • Loading branch information
landaisbenj authored Oct 30, 2018
1 parent 18ce263 commit b18554c
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion custom.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,30 @@
$( document ).ready(function() {

var targetedNode = holder[0]


// Create an observer instance linked to the callback function
var observer = new MutationObserver(function(mutationsList, observer) {
$(mutationsList).each(function(index, item){
if (item.type === 'childList'){

if (item.addedNodes.length > 0){
alert('new div is being added!');
}

if (item.removedNodes.length > 0){
alert('div has been removed');
}

}
});
});

// Start observing the target node for configured mutations
observer.observe(targetedNode, {
attributes: true,
childList: true,
subtree: true
});



Expand Down

0 comments on commit b18554c

Please sign in to comment.