Class BTM.UI.ImageViewer
Extends
BTM.UI.WindowBase.
LightBox-style popup Image Viewer with navigation, auto-scaling, image titles and descriptions
Defined in: ui.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
BTM.UI.ImageViewer(element, options)
|
| Field Attributes | Field Name and Description |
|---|---|
|
The index of the current image
|
|
|
Array of image types to support
|
- Fields borrowed from class BTM.UI.WindowBase:
- open
| Method Attributes | Method Name and Description |
|---|---|
|
flipImage(event, direction)
Change the current Image shown in the Image Viewer Window "left" or "right", to show the next or previous Image.
|
|
|
Hide the Image Viewer Window
|
|
|
Initialize the Images Array
|
|
|
initLink(element, index)
Initialize each Link
|
|
|
Initialize the Image Viewer Window
|
|
|
loadImage(index)
Load an image
|
|
|
Scale the image to fit within the available space
|
|
|
showImage(event, index)
Show an Image in the Image Viewer Window
|
|
|
showMoreInfo(event)
Show More information about an Image (from the longdesc attribute on the IMG tag)
|
- Methods borrowed from class BTM.UI.WindowBase:
- attachWindow, fullScreenResize, hide, init, resizeWindow, show
| Event Attributes | Event Name and Description |
|---|---|
|
imageHasLoaded(index)
Event listener for when Image has loaded
|
|
|
keyPress(event)
Listener for key-press event to support Image Viewer naviagtion and closing the Image Viewer Window
|
Class Detail
BTM.UI.ImageViewer(element, options)
- Parameters:
- {HTMLElement|String} element
- element ID or reference to element containing links to images
- {Object} options Optional
- options Object
Field Detail
currentImage
The index of the current image
{String[]}
imageTypes
Array of image types to support
Method Detail
flipImage(event, direction)
Change the current Image shown in the Image Viewer Window "left" or "right", to show the next or previous Image.
var t = new BTM.UI.ImageViewer(document.body); t.showImage(false, 0); t.flipImage(-2); // Changes the display to the second to last Image in the Images Array - first image - 2 = second to last image t.flipImage(3); // Changes the display to the second Image in the Images Array - second to last image + 3 = 2nd image
- Parameters:
- {Event} event
- the Event that triggered this
- {Number} direction
- number to add to the current Images' index, to select the new Image
hideImage()
Hide the Image Viewer Window
initImages()
Initialize the Images Array
{Object}
initLink(element, index)
Initialize each Link
- Parameters:
- {HTMLElement|String} element
- element ID or reference to the Anchor element
- {Number} index
- the Index for this entry in the Images Array.
- Returns:
- {Object} an Object containing a various peices of information about the Link and the Image
- See:
- initImages
initWindow()
Initialize the Image Viewer Window
loadImage(index)
Load an image
- Parameters:
- {Number} index
- the Index of the Image to load
scaleImage()
Scale the image to fit within the available space
showImage(event, index)
Show an Image in the Image Viewer Window
- Parameters:
- {Event} event
- the event that triggered this
- {Number} index
- the Index of the Image to show
showMoreInfo(event)
Show More information about an Image (from the longdesc attribute on the IMG tag)
- Parameters:
- {Event} event
- the event that triggered this
- See:
- BTM.UI.HTMLWindow
Event Detail
imageHasLoaded(index)
Event listener for when Image has loaded
- Parameters:
- {Number} index
- the Index of the Image that has loaded
keyPress(event)
Listener for key-press event to support Image Viewer naviagtion and closing the Image Viewer Window
- Parameters:
- {Event} event
- object