Constructor
# new Carousel(config)
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
config |
object
|
||
images |
Array.<string>
|
List of image src |
|
width |
string
|
number
|
<optional> |
Any valid CSS width value |
height |
string
|
number
|
<optional> |
Any valid CSS height value |
delay |
number
|
<optional> |
Auto slide delay in milliseconds (default = 3000) |
showArrows |
boolean
|
<optional> |
Display left/right arrows on hover |
zoomable |
boolean
|
<optional> |
Enable zoom on active image click |
zoomWidth |
string
|
number
|
<optional> |
Zoomed image width (default = 100%) |
zoomHeight |
string
|
number
|
<optional> |
Zoomed image height (default = 100%) |
zoomShadow |
string
|
<optional> |
Box shadow applied to zoomed image |
this
Generated markup
<a-carousel class="a-carousel">
<div class="carousel-track">
<img class="carousel-image carousel-image-active">
</div>
<span class="carousel-arrow carousel-arrow-left fas fa-chevron-left"></span>
<span class="carousel-arrow carousel-arrow-right fas fa-chevron-right"></span>
</a-carousel>
Methods
# goTo(index, isAutoopt, transitionAnimationopt)
Go to an image by index
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
index |
number
|
Target index |
||
isAuto |
boolean
|
<optional> |
false | True when called by automatic rotation |
transitionAnimation |
string
|
<optional> |
this
# next(isAutoopt)
Go to the next image
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
isAuto |
boolean
|
<optional> |
false | True when called by automatic rotation |
this
# setHeight(height)
Set carousel height
Parameters:
| Name | Type | Description |
|---|---|---|
height |
*
|
A valid CSS height value |
this
# setWidth(width)
Set carousel width
Parameters:
| Name | Type | Description |
|---|---|---|
width |
*
|
A valid CSS width value |
this
# setZoom(zoomStateopt)
Set zoom state
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
zoomState |
boolean
|
<optional> |
true |
this