The ImageViewer requires that your browser support the HTML5 Canvas Element.
To understand the various elements of the ImageViewer, consider an example where you have the following HTML:
<div id="imageViewerContainer" style="width:800px; height:800px"></div>
When the ImageViewer has been created, that original div
will have child elements:
<!-- The original container div -->
<div id="imageViewerContainer">
<!-- Image Viewer Parts are created as child elements of the div passed by the user -->
<!-- The main div for the viewer -->
<div class="lt-imageviewer-main">
<!-- The viewer auto scroll div, when scroll mode is Auto -->
<div class="lt-imageviewer-autoscroll"></div>
</div>
<!-- The holder for the view div (Elements Mode only) -->
<div class="lt-imageviewer-viewholder">
<!-- The view div (Elements Mode only) -->
<div class="lt-view"></div>
</div>
<!-- The viewer events canvas (Elements Mode only) -->
<canvas class="lt-imageviewer-eventcanvas"></canvas>
<!-- The viewer pass-through div (Elements Mode only) -->
<div class="lt-imageviewer-passthrough"></div>
<!-- The viewer foreground canvas -->
<canvas class="lt-imageviewer-forecanvas"></canvas>
<!-- The viewer image loading div (hidden) -->
<div class="lt-imageviewer-images"></div>
</div>
From the above, you can deduce that creating an image viewer inside a div
will add the following elements to your HTML page:
Element | CSS class name used for styling | ImageViewer property | Description |
---|---|---|---|
Main Viewer Div | lt-imageviewer-main |
MainDiv |
A container |
Auto Scroll Div | lt-imageviewer-autoscroll |
AutoScrollDiv |
The auto scroll |
View Holder Div | lt-imageviewer-viewholder |
ViewDivHolder |
The view holder |
View Div | lt-imageviewer-view |
ViewDiv |
The view |
Event Canvas | lt-imageviewer-eventcanvas |
EventCanvas |
The event |
Pass-through Div | lt-imageviewer-passthrough |
PassthroughDiv |
The pass-through |
Foreground Canvas | lt-imageviewer-forecanvas |
ForeCanvas |
The foreground |
Image Loading Div | lt-imageviewer-images |
ImagesDiv |
This |
If the image viewer is not using Elements Mode, then in addition to these elements, the image viewer will create an img
or a canvas
element for each item to hold the image data. These items are not added to the HTML page. They are rendered into the foreground canvas
using the render cycle.
If the image viewer uses Elements Mode, then it will add the item's HTML elements (img
or canvas
) to the DOM. See the Elements Mode topic for more information on that ImageViewer structure.