Skip to content

3. Default types

Matthieu Stroh edited this page Jun 28, 2019 · 2 revisions

Global options

Mandatory parameters to supply for every types

Name Type Default value Description
group string - Lightbox UID
type string - Element type should be either image, video, youtube, map or any registered custom type
* target string - Trigger

Image - image

Display a regular image

Options

Name Type Default value Description
src string - Image URL
* width number -1 Width in px, by default -1 it uses native width
* height number -1 Height in px, by default -1 it uses native height
* alt string - Alternate text

Example

{
    "type": "image",
    "group": "lightbox-1", 
    "src": "./img/poney.jpg",       
    "alt": ""
}

Google Map - map

Display a Google Map within the lightbox

Options

Name Type Default value Description
api_key string - Google Map API key
lat number 0.0 Latitude
lng number 0.0 Longitude
* zoom number 8 Zoom level
* width number 1024 Width in px
* height number 720 Height in px
* lang string fr Language
* styles Array - Map styles objects https://mapstyle.withgoogle.com

Example

{ 
    "type": "map", 
    "group": "lightbox-1", 
    "api_key": "YOUR_API_KEY", 
    "lat": 48.5692059, 
    "lng": 7.692055, 
    "zoom": 15, 
    "width": 1600, 
    "height": 900,
}

Youtube video player - youtube

Display a Youtube video with the iframe API

Options

Name Type Default value Description
src string - URL to a youtube video
* width number 854 Width in px
* height number 480 Height in px
* rel boolean true Toggle related videos
* autoplay boolean false Toggle autoplay
* controls boolean true Toggle controls
* showinfo boolean true Toggle video information
* start number 0 Start the video at a given timecode
* allowFullscreen boolean true Allow/disallow fullscreen

Example

{ 
    "type": "youtube", 
    "group": "lightbox-1",
    "src": "https://www.youtube.com/watch?v=9rIy0xY99a0", 
    "autoplay": false, 
    "rel": false, 
    "showinfo": false,
    "controls": true, 
    "allowFullscreen": false,
}

HTML5 video player - video

Display a video with the HTML5 API

Options

Name Type Default value Description
src string - Source of the video
* width number 854 Width in px
* height number 480 Height in px
* autoplay boolean false Toggle autoplay
* controls boolean true Toggle controls

Example

{ 
    "type": "video", 
    "group": "lightbox-1",
    "src": "./video/poney.mp4", 
    "autoplay": false,
    "controls": true,
}