Document Solutions Image Viewer
    Preparing search index...

    Interface EventBus

    The image viewer event bus. Use the event bus to listen and receive certain specific "events". Available events are: "before-open", "after-open", "before-close", "after-close", "zoom-changed", "frame-index-changed", "animation-started", "animation-stopped".

    // Listen frame index changes:
    viewer.eventBus.on("frame-index-changed", function(args) { console.log("Image frame changed", args); });
    // Listen "after-open" event once:
    viewer.eventBus.on("after-open", function(args) { console.log("Image opened", args); }, { once: true });
    interface EventBus {
        dispatch(eventName: EventBusEventName, data: any): void;
        on(
            eventName: EventBusEventName,
            listener: EventBusEventListener,
            options?: EventBusAttachOptions,
        ): void;
        offAll(eventName: EventBusEventName): void;
        off(eventName: EventBusEventName, listener: EventBusEventListener): void;
    }

    Methods

    • Remove all event listeners for the event specified by the eventName argument.

      Parameters

      Returns void