src/eventsource.js
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 };
        }
    }
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 };
        }
    }
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 } ; } }
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.
Add an event handler for a given event .