Created
April 4, 2014 21:46
-
-
Save hontas/9983730 to your computer and use it in GitHub Desktop.
A simple DOM-change handler using MutationObserver
This file contains 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
// 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