Skip to content

2. Optional parameters

Metter-Rothan Jérémie edited this page Aug 31, 2018 · 10 revisions
Name Type Default value Description
uid string uniqid() Unique lightbox identifier
enableCloseOnBlur boolean true Close on clicking outside of the content
enableCloseOnEscape boolean true Close on pressing the escape key
enableArrowKey boolean true Navigate between the elements with the arrow keys
enableAnimations boolean true Use animation to make smooth transitions
enableCloseUI boolean true Display the close button
enableNavUI boolean true Display the navigation buttons
enablePaginationUI boolean true Display the pagination information
enableBulletlistUI boolean true Display a bulletlist navigation
enableTransition boolean false Add a UI transition effect on navigation
rewind boolean true Navigation loop
animation.open function - Lightbox opening animation
animation.close function - Lightbox closing animation
animation.showElement function - Lightbox displaying element animation

Example

const lightbox = new Lightbox({
    uid: 'lightbox-1',
    enableCloseOnBlur: true,
    enableCloseOnEscape: true,
    enableArrowKey: false,
    enableAnimations: false,
    enableCloseUI: false,
    enableNavUI: false,
    enablePaginationUI: false,
    enableBulletlistUI: true,
    rewind: true,
    animation: {
      open: () => { ... },
      close: () => { ... },
      showElement: () => { ... },
    }
});