eardrum.js live example

Playground

You can modify the parameters of eardrum.watch calls here.

Warning: do not paste any code that you don't understand

Output (JSON)

object ==> {}

API

Create a new butterfly and use it in eardrum.watch method

Code:

var myObject = {};
var newButterfly = createButterfly();

eardrum.watch({
  object: myObject,
  property: 'property',
  handler: function (mouseEvent, config) {
    moveButterfly(mouseEvent, newButterfly);
  },
  listener: {
    target: window,
  type: 'mousemove'
  },
  additionalRefProperties: {
    butterfly: newButterfly
  }
});