Skip to content

Instantly share code, notes, and snippets.

@hontas
Created April 4, 2014 21:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hontas/9983730 to your computer and use it in GitHub Desktop.
Save hontas/9983730 to your computer and use it in GitHub Desktop.
A simple DOM-change handler using MutationObserver
// MutationObserver
(function(){
var pluginName = "domChangeHandler";
var defaults = {};
var DOMChangeHandler = function(HTMLElement, options) {
this.options = options || {};
this.handler = new MutationsObserver(changeEventHandler);
this.handler.observe(HTMLElement);
return this;
}
// shorthand to prototype
DOMChangeHandler.fn = DOMChangeHandler.prototype;
}())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment