class
SAPO.Ink.Gallery
Version:
0.1
The gallery provides a way of displaying an array of images. It can be initialized by either the microformats-only ul-based DOM markup or a JSON model TODOs: - reapply microformats to final markup Microformats consumed: hentry - http://microformats.org/wiki/hentry hmedia - http://microformats.org/wiki/hmedia
Since:
Defined in
Ink/Gallery/0.1/lib.js
October 2012
Constructor Summary
Function Summary
destroy()
unregisters the component and removes its markup from the DOM
Number
getIndex()
returns the index of the current image
Number
getLength()
returns the number of images in the gallery
moves gallery to the nth - 1 image
next()
move to the next image
previous()
move to the previous image
moves gallery to the nth - 1 thumb
move to the next thumb
move to the previous thumb
Constructor Details
constructor Gallery
Gallery(String|DOMElement
selector, Object
options)
Parameters:
selector
options
-
[ Boolean circular ]
whether to allow wrapping the limits of the collection or stop at end/beginning. defaults to false -
[ Number layout ]
0-3. defaults to 0 -
[ Boolean fixImageSizes ]
if true, image sizes are inspected via preload or read from dims/width+height and made to respect the container dims (by default 600x400)
Function Details
function destroy
destroy()
unregisters the component and removes its markup from the DOM
function getIndex
Number
getIndex()
returns the index of the current image
function getLength
Number
getLength()
returns the number of images in the gallery
function goTo
goTo(Number
i, [Boolean
isRelative])
moves gallery to the nth - 1 image
Parameters:
i
absolute or relative index
[isRelative]
pass true for relative movement, otherwise absolute function next
next()
move to the next image
function previous
previous()
move to the previous image
function thumbGoTo
thumbGoTo(Number
i, [Boolean
isRelative])
moves gallery to the nth - 1 thumb
Parameters:
i
absolute or relative index
[isRelative]
pass true for relative movement, otherwise absolute function thumbNext
thumbNext()
move to the next thumb
function thumbPrevious
thumbPrevious()
move to the previous thumb