Properties
<li>
element that contains the carousel.
<li>
element of the current image.
<li>
elements that have thumbnails.
<li>
that has the gallery caption.
<img>
element that'll display the current image.
<p>
element that holds the image caption.
<div>
element that contains the image.
<div>
element that contains the interface buttons.
imageHeight :number
#
Height of the image based on viewport size the URLs in the required size.
Type:
imageInfoCache :Object.<string, jQuery.Promise>
#
A key value pair of thumbnail URLs and image info.
Type:
Methods
drawCarousel()
#
Draws the carousel and the interface around it.
getChromeHeight() → {number}
#
Gets the height of the interface elements and the gallery's caption.
getCurrentImage() → {jQuery}
#
$currentImage
.
getDimensionToRequest($img) → {string}
#
Given an image, the method checks whether to use the height or the width to request the larger image.
getImageInfo($img) → {jQuery.Promise}
#
Gets the image's info given an <img>
element.
Parameters:
Name | Type | Description |
---|---|---|
$img |
Object |
Returns:
Resolves with the image's info.
- Type
- jQuery.Promise
<img>
element.
getNextImage() → {jQuery}
#
Gets the image after the current one. Returns the first image if the current one is the last.
Returns:
- Type
- jQuery
getPrevImage() → {jQuery}
#
Gets the image before the current one. Returns the last image if the current one is the first.
Returns:
- Type
- jQuery
loadImage($img) → {jQuery.Promise}
#
Loads the full image given the <img>
element of the thumbnail.
Parameters:
Name | Type | Description |
---|---|---|
$img |
jQuery |
Returns:
Resolves with the image's URL and original element once the image has loaded.
- Type
- jQuery.Promise
<img>
element of the thumbnail.
nextImage()
#
Sets the $currentImage
to the next one and shows
it in the carousel.
Sets the $currentImage
to the next one and shows
it in the carousel.
prevImage()
#
Sets the $currentImage
to the previous one and
shows it in the carousel.
Sets the $currentImage
to the previous one and
shows it in the carousel.
setImageSize()
#
Sets the height and width of $img
based on the
proportion of the image and the values generated by
setSizeRequirement
.
Sets the height and width of $img
based on the
proportion of the image and the values generated by
setSizeRequirement
.
setSizeRequirement()
#
Sets the imageWidth
and
imageHeight
properties based on the size of the
window. Also flushes the imageInfoCache
as we'll
now need URLs for a different size.
Sets the imageWidth
and
imageHeight
properties based on the size of the
window.
showCurrentImage(init)
#
Displays the image set as $currentImage
in the
carousel.
Parameters:
Name | Type | Description |
---|---|---|
init |
boolean | Image being shown during gallery init (i.e. first image) |
Displays the image set as $currentImage
in the
carousel.