new Gallery(element, options)
The Gallery Class constructor
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
element |
HTMLElement | the container element which the gallery will live in | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
options |
Object | optional gallery behavior
Properties
|
- Source:
Members
active
Get currently-active gallery item
- Source:
activeIndex
Get the index of the currently-active gallery item
- Source:
Methods
draggablePointerDown(e)
Stores the x-position of mouse/touch input
Parameters:
Name | Type | Description |
---|---|---|
e |
Object | the event object |
- Source:
draggablePointerUp(e)
Advance gallery if drag distance meets or exceeds the established threshold.
Parameters:
Name | Type | Description |
---|---|---|
e |
Object | the event object |
- Source:
handleAutoplay()
Handles the setting of the timer for autoplay galleries,
taking into consideration the document's visibility state.
- Source:
handlePagination(e)
Advances gallery to the index of the selected pagination item.
Parameters:
Name | Type | Description |
---|---|---|
e |
Object | the event object |
- Source:
handleVisibilityChange()
Fires when the document's visbility chnages from the "hidden" state;
Resumes autoplay functionality if applicable.
- Source:
itemTransitioned(item) → {class}
Helper method to remove CSS transition classes
Parameters:
Name | Type | Description |
---|---|---|
item |
DOMNode | Gallery item. |
- Source:
Returns:
This.
- Type
- class
loaded() → {class}
Removes loading classes and starts autoplay.
- Source:
Returns:
This
- Type
- class
move(direction) → {class}
Changes active item
Parameters:
Name | Type | Default | Description |
---|---|---|---|
direction |
boolean | true | True = forwards. False = backwards |
- Source:
Returns:
This
- Type
- class
moveByIndex(index) → {class}
Changes active item based on its index, starts at 0
Parameters:
Name | Type | Description |
---|---|---|
index |
number |
- Source:
Returns:
This
- Type
- class
next() → {class}
Move forward
- Source:
Returns:
This.
- Type
- class
pause() → {class}
Pause autoplaying gallery
- Source:
Returns:
This.
- Type
- class
prev() → {class}
Move backwards
- Source:
Returns:
This.
- Type
- class
resize() → {class}
Adjust main wrapper height.
- Source:
Returns:
This
- Type
- class
resume() → {class}
Resume autoplaying gallery
- Source:
Returns:
This.
- Type
- class