Gallery

Gallery

Source:
Parameters:
NameTypeDescription
elementHTMLElement

DOM element for component instantiation and scope

optionsObject
Properties
NameTypeDescription
galleryItemSelectorString

Selector for gallery element

descriptionSelectorString

Selector for gallery description element

titleSelectorString

Selector for gallery title element

closeButtonSelectorString

Selector for close button element

allButtonSelectorString

Selector for view all button element

overlaySelectorString

Selector for gallery overlay element

overlayHeaderSelectorString

Selector for gallery overlay header element

overlayFooterSelectorString

Selector for gallery overlay footer element

overlayMediaSelectorString

Selector for gallery overlay media element

overlayCounterCurrentSelectorString

Selector for gallery overlay current number element

overlayCounterMaxSelectorString

Selector for display of number of elements in the gallery overlay

overlayDownloadSelectorString

Selector for gallery overlay download element

overlayShareSelectorString

Selector for gallery overlay share element

overlayDescriptionSelectorString

Selector for gallery overlay description element

overlayPreviousSelectorString

Selector for gallery overlay previous link element

overlayNextSelectorString

Selector for gallery overlay next link element

videoTitleSelectorString

Selector for video title

attachClickListenerBoolean

Whether or not to bind click events

attachKeyListenerBoolean

Whether or not to bind keyup events

Classes

Gallery

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:
NameTypeDescription
eEvent

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:
NameTypeDescription
eEvent

handleKeyPressOnItem(e)

Description:
  • Invoke listeners for on pressing the spacebar button.

Source:
Parameters:
NameTypeDescription
eEvent

handleKeyboard(e)

Description:
  • Handles keyboard events such as Escape and navigation.

Source:
Parameters:
NameTypeDescription
eEvent

handleResize()

Description:
  • Trigger events on resize Uses a debounce, for performance

Source:

hideItems(rows/item)

Source:
Parameters:
NameTypeDescription
rows/itemInt

number

Hide several gallery items by default

  • 2 "lines" of items on desktop
  • only 3 items on mobile or the desired rows or items when using the view more button.

init()

Description:
  • Initialise component.

Source:

preventClickOnItem(e)

Description:
  • handle click event on gallery items when no overlay.

Source:
Parameters:
NameTypeDescription
eEvent

updateOverlay(selectedItem)

Source:
Parameters:
NameTypeDescription
selectedItemHTMLElement

Media element

(static) autoInit(root) → {Gallery}

Source:
Parameters:
NameTypeDescription
rootHTMLElement

DOM element for component instantiation and scope

Returns:

An instance of Gallery.

Type
Gallery