lib/effroi.js
function(element, options) {
    var event;
    options = options || {};
    options.canBubble = ('false' === options.canBubble ? false : true);
    options.cancelable = ('false' === options.cancelable ? false : true);
    options.view = options.view || window;
    try {
        event = new Event(options.type, {
          bubbles: options.canBubble,
          cancelable: options.cancelable,
          view: options.view,
          relatedTarget: options.relatedTarget
        });
        return element.dispatchEvent(event);
    } catch(e) {
      try {
        event = document.createEvent("Event");
        event.initEvent(options.type,
          options.canBubble, options.cancelable);
        this.setEventProperty(event, 'relatedTarget', options.relatedTarget);
        return element.dispatchEvent(event);
      } catch(e) {
        // old IE fallback
        event = document.createEventObject();
        event.eventType = options.type;
        event.relatedTarget = options.relatedTarget;
        return element.fireEvent('on'+options.type, event)
      }
    }
  }
function(element, options) {
    var event;
    options = options || {};
    options.canBubble = ('false' === options.canBubble ? false : true);
    options.cancelable = ('false' === options.cancelable ? false : true);
    options.view = options.view || window;
    try {
        event = new Event(options.type, {
          bubbles: options.canBubble,
          cancelable: options.cancelable,
          view: options.view,
          relatedTarget: options.relatedTarget
        });
        return element.dispatchEvent(event);
    } catch(e) {
      try {
        event = document.createEvent("Event");
        event.initEvent(options.type,
          options.canBubble, options.cancelable);
        this.setEventProperty(event, 'relatedTarget', options.relatedTarget);
        return element.dispatchEvent(event);
      } catch(e) {
        // old IE fallback
        event = document.createEventObject();
        event.eventType = options.type;
        event.relatedTarget = options.relatedTarget;
        return element.fireEvent('on'+options.type, event)
      }
    }
  }
function ( element , options ) { var event ; options = options || { } ; options . canBubble = ( 'false' === options . canBubble ? false : true ) ; options . cancelable = ( 'false' === options . cancelable ? false : true ) ; options . view = options . view || window ; try { event = new Event ( options . type , { bubbles : options . canBubble , cancelable : options . cancelable , view : options . view , relatedTarget : options . relatedTarget } ) ; return element . dispatchEvent ( event ) ; } catch ( e ) { try { event = document . createEvent ( "Event" ) ; event . initEvent ( options . type , options . canBubble , options . cancelable ) ; this . setEventProperty ( event , 'relatedTarget' , options . relatedTarget ) ; return element . dispatchEvent ( event ) ; } catch ( e ) { // old IE fallback event = document . createEventObject ( ) ; event . eventType = options . type ; event . relatedTarget = options . relatedTarget ; return element . fireEvent ( 'on' + options . type , event ) } } }
dispatch a simple event
dispatch a simple event