code: function ( eventName, handler, userData ) {
          var events = this.events[ eventName ];
          if ( !events ) {
              this.events[ eventName ] = events = [];
          }
          if ( handler && $.isFunction( handler ) ) {
              events[ events.length ] = { handler: handler, userData: userData || null };
          }
      }
docs: Add an event handler for a given event.
  @function
  @param {String} eventName - Name of event to register.
  @param {OpenSeadragon.EventHandler} handler - Function to call when event is triggered.
  @param {Object} [userData=null] - Arbitrary object to be passed unchanged to the handler.