Event callbacks event-callbacks
The viewer supports JavaScript event callbacks that the web page uses to track the viewer initialization process or runtime behavior.
Callback handlers are assigned by passing event names and corresponding handler functions with the handlers
property to config
JSON object in the viewer’s constructor. Alternatively, it is possible to use setHandlers()
API method.
Supported viewer events include the following:
Triggers each time an event occurs inside the viewer which may be handled by an event tracking system, such as Adobe Analytics. The callback handler accepts the following arguments:
-
objID {String} - not currently used.
-
compClass {String} - not currently used.
-
instName {String} - an instance name of the Viewer SDK component that triggered the event.
-
timeStamp {Number} - event time stamp.
-
eventInfo {String} - event payload.
Triggers when the user activates a hotspot with Quickview data associated with it. The callback handler takes the following argument:
- data {Object} - a JSON object containing data from the hotspot definition. The field sku is mandatory while other fields are optional and depend on the source hotspot definition.
See also InteractiveImage and setHandlers.