The jQuery plugin namespace.
Methods
(static) pccViewer(optionsopt) → {PCCViewer.Viewer}
Creates and embeds a new viewer in the first element of the set of matched elements.
Each call to this method will create and return a unique ViewerControl object. This will call PCCViewer.Viewer#destroy on any existing viewer embedded in the selected element.
If plugin options are provided, then a new viewer is created in the selected element and a PCCViewer.Viewer object is returned. This will call PCCViewer.Viewer#destroy on any viewer that already existed in the selected element.
If plugin options are not provided, then a viewer is not created. Instead, the PCCViewer.Viewer object associated with an existing viewer is returned.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
options |
jQuery.fn.pccViewer~Options | <optional> |
Plugin options. |
Returns:
- Type
- PCCViewer.Viewer
Example
//Note: these are already included in the PCC Samples
var pluginOptions = {
documentID: viewingSessionId, // documentID is a required property
language: languageItems // language is a required property
};
$(document).ready(function () {
// Creates a new viewer in the div with id="viewer1"
var viewer = $("#viewer1").pccViewer(pluginOptions);
// Can also access the returned object through the plugin.
var viewerA = $("#viewer1").pccViewer(); // Does not create a new viewer.
viewerA === viewer; // true
});