new Gallery(element, options)
- Source:
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
element |
HTMLElement | DOM element for component instantiation and scope |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
options |
Object |
Properties
|
Classes
Methods
checkScreen()
- Description:
Check if current display is desktop or mobile
- Source:
destroy()
- Description:
Destroy component.
- Source:
handleClickOnCloseButton()
- Description:
Invoke listeners for close events.
- Source:
handleClickOnItem(e)
- Description:
Invoke listeners for on click events on the given gallery item.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
e |
Event |
handleClickOnNextButton()
- Description:
Invoke listeners for on click events on next navigation link.
- Source:
handleClickOnPreviousButton()
- Description:
Invoke listeners for on click events on previous navigation link.
- Source:
handleClickOnViewAll(e)
- Description:
Invoke listeners for on click events on view all.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
e |
Event |
handleKeyPressOnItem(e)
- Description:
Invoke listeners for on pressing the spacebar button.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
e |
Event |
handleKeyboard(e)
- Description:
Handles keyboard events such as Escape and navigation.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
e |
Event |
handleResize()
- Description:
Trigger events on resize Uses a debounce, for performance
- Source:
hideItems(rows/item)
- Source:
Parameters:
Name | Type | Description |
---|---|---|
rows/item |
Int | number Hide several gallery items by default
|
init()
- Description:
Initialise component.
- Source:
preventClickOnItem(e)
- Description:
handle click event on gallery items when no overlay.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
e |
Event |
updateOverlay(selectedItem)
- Source:
Parameters:
Name | Type | Description |
---|---|---|
selectedItem |
HTMLElement | Media element |
(static) autoInit(root) → {Gallery}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
root |
HTMLElement | DOM element for component instantiation and scope |
Returns:
An instance of Gallery.
- Type
- Gallery