Magic LightBox API

Quick Start

Load jQuery, magic-lightbox.min.css, magic-lightbox.min.js and optionaly mlb-ie8-min.css and mlb-ie8-min.js:

        <!--[if IE 8 ]>
        <link rel="stylesheet" href="../sources/css/mlb-ie8.css">
        <script src="//code.jquery.com/jquery-1.11.2.min.js"></script>
        <script src="//code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
        <script type="text/javascript" src="../sources/js/mlb-ie8.js"></script>
       
        <![endif]-->
        <!--[if (gte IE 9)|!(IE)]><!-->
        <link rel="stylesheet" href="../sources/css/magic-lightbox.css">
        <script type="text/javascript" src="../jquery/jquery.min.js"></script>
        <script type="text/javascript" src="../sources/js/magic-lightbox.js"></script>
        <!--<![endif]-->

If you don't like IE8, you can use this code:

  <link rel="stylesheet" href="../sources/css/magic-lightbox.css">
  <script type="text/javascript" src="../jquery/jquery.min.js"></script>
  <script type="text/javascript" src="../sources/js/magic-lightbox.js"></script>

Define options:

  var options = {
    triggers: {
      click: "a.ajax"
    }
  };

Create a new object of the MagicLightBox class:

 var lb = MagicLightBox(options);

General Information

You can define properties on 3 levels: general, views and markup.

General level

General properties are applicable for all views and triggers. Some of these properties (but not all) can be overridden on the "view" level or by markup.

  var options = {
    sloganCss: "color: #ffffdb;",
    sloganCssMobile: "font-size: 32px;",
    triggers: {
      body: "body",
      click: "a.ajax, a.no-ajax",
      invis: "a.ajax, a.no-ajax"
    }
  };

"View" level

To move on this level you must define a "views" object which in turn is an array of objects:

  var options = {
   ...
    views: {
      more: {
        imageCss: "background-image: url(images/gallery/info-bg.png); background-repeat: repeat;",
        sloganCss: "opacity: 0.7; color: gray; background-color: white; padding: 20px 40px;",
        slogan: "Details"
      },
      more1: {
        cssClass: "more",
        imageCss: "background-image: url(images/bg.png); background-repeat: repeat;",
        sloganCss: "opacity: 0.7; color: black; background-color: gray; padding: 20px 40px;",
        slogan: "Details"
      },
      form: {
        slogan: "Choose Your Effect!",
        sloganCss: "opacity: 0.8; color: white;font-size: 62px; font-family: 'Nunito', sans-serif;",
        imageCss: "background-image: url(images/gallery/sunset.jpg)"
      }
    }
 
   ...
  };

Some of these properties (but not all) can be overridden by markup.

If you want the trigger to have a view, use a "data-view" attribute:

<a href="" class="no-ajax btn btn-default"
   data-view="yt"
 >Go!</a>

Why do we need views?

Views help us to specify properties which are general for a group of triggers (a view). Otherwise we had to define these properties for every trigger.

Moreover we couldn't work in an "image" mode without using views.

"Markup" level

If you need to specify a property for a trigger, use markup.

<a href="staff/employee.php?id=1&tab=send"
   class="btn btn-default ajax"
   data-view="card"
   data-slogan="e"
   data-slogan-css="font-family: 'staff'; font-size: 200px;"
   data-slogan-css-mobile="font-size: 100px;"
   data-image-css="background-image: url(images/bg.png); background-repeat: repeat;"
>Go!</a>

Modes of Magic LightBox

Magic LightBox can work in 3 modes:

  • Image mode
  • AJAX mode
  • HTML mode

If you want Magic LightBax to work in the "image" mode, use the view "mode" property :

image_base: {
   mode: "image",
   color: "black",
   gallery: "#base",
   sloganCss: "opacity: 0.5;text-shadow: 0 1px 6px rgba(0, 0, 0, 1);"
}

If you want Magic LightBax to work in the "html" mode, specify the "data-element" attribute:

<a class="btn btn-primary btn-lg no-ajax"
   href="" role="button"
   data-view="form"
   data-effect="cube"
   data-element ="#element"
   >Choose Your Effect!</a>

General properties

bottomEffects

Type: String

the string of "bottom" directional effects

Default: "fadebottom cubefadebottom cubefadebottommin columnbottom rowbottom colfadebottomdiamond colfadebottomwavy"

Example:

    var options = {
      ...
 
      bottomEffects: "fadebottom cubefadebottom",
 
      ...
    }

color

Type: String

the background color of shutters and openers

Default: rgb(169, 169, 169)

Example:

     
      color: "steelblue",
     

content

Type: Selector

Mode: AJAX

the selector of the element (with all child elements) that will be shown when AJAX content is loaded. All other content of the response from the server will be ignored.

Default: "#content"

Example:

    var options = {
 
      ...
      content: "#ajax-container",
      ...
    }

effects

Type: String

the list of effects (space separated)

Default: "cube rowleft columntop cubezoom cubemin cubezoommin cubezoomminwavy zoom fade fadetop fadebottom fadeleft faderight cubefadetop cubefadebottom cubefadeleft cubefaderight cubefadetopmin cubefadebottommin cubefadeleftmin cubefaderightmin cuberollleftmin cuberollrightmin cuberollleft cuberollright rollleft rollright columnbottom rowright rowtop rowbottom columnleft columnright row column rowcontra columncontra rowcontramin columncontramin rowmin columnmin cubefadetopleft cubefadetopright cubefadebottomleft cubefadebottomright cubefadecontrah cubefadecontrav cuberolcontra cuberolcontramin cuberotate columnzoom rowzoom colfadetopdiamond colfadetopwavy rowfadeleftdiamond rowfadeleftwavy colfadediamond colfadewavy rowfadediamond rowfadewavy columnfadediamond columnfadewavy rowfadecontradiamond rowfadecontrawavy rowfaderightdiamond rowfaderightwavy colfadebottomdiamond colfadebottomwavy"

Example:

    var options = {
     ...
 
      effects: "fadebottom cubefadebottom cubezoomminwavy zoom fade fadetop"
 
     ...
    }

imageCss

Type: String

The style for the background image.

if you want an image to be included to animation as a background you should define this parameter.

Example:

 imageCss: "background-image: url(images/gallery/info-bg.png); background-repeat: repeat;"

imageCssMobile

Type: String

The style for the background image that will be applied if a width of the Window <= 500px

Example:

 imageCss: "background-image: url(images/gallery/info-bg-1.png); background-repeat: repeat;"

isBottomMenu

Type: Boolean

Mode: image

if the value is true the bottom menu will be switched on when you initially open the LightBox.

Default: true

Example:

    var options = {
     
      ...
      isBottomMenu: true,
      isTopMenu: false,
      ...
     
     
    }

isTopMenu

Type: Boolean

Mode: image

if the value is true the top menu will be switched on when you initially open the LightBox.

Default: true

Example:

    var options = {
     
      ...
      isBottomMenu: true,
      isTopMenu: false,
      ...
     
     
    }

leftEffects

Type: String

the string of "left" directional effects

Default: "rowleft fadeleft cubefadeleft cubefadeleftmin cuberollleftmin cuberollleft rollleft columnleft colfadewavy rowfadeleftwavy"

Example:

     
     leftEffects: "fadeleft cubefadeleft cubefadeleftmin"
     

onContentLoaded

Type: Function

the function that should be executed when the content is loaded to the LightBox

Example:

   
    onContentLoaded: function () {
      $(document).trigger("loaded");
    },
   

onRender

Type: Function

the function that should be done on MagicLightBox render

Example:

   
    onRender: function () {
      $(document).trigger("rendered");
    }

rightEffects

Type: String

the string of "right" directional effects

Default: "faderight cubefaderight cubefaderightmin cuberollrightmin cuberollright rollright rowright columnright rowfaderightdiamond rowfaderightwavy"

Example:

    var options = {
 
    ...
     
     rightEffects: "cuberollright",
 
    ...
     
    }

shuffle

Type: Boolean

if the value is true the array of effects will be shuffled

Default: true

Example:

    var options = {
     ...
     effects: "faderight cubefadetop cubefadebottom cubefadeleft cubefaderight " +
      "cubefadetopmin cubefadebottommin cubefadeleftmin cubefaderightmin " +
      "cuberollleftmin cuberollrightmin cuberollleft cuberollright rollleft " +
      "rollright columnbottom rowright rowtop rowbottom columnleft columnright " +
      "row column rowcontra columncontra rowcontramin columncontramin rowmin",
      shuffle: false,
     ...
    }

slogan

Type: String

the text that will be shown as a slogan

Example:

     slogan: "Magic LightBox",

sloganCss

Type: String

The style for the slogan

Example:

sloganCss: "color: #ffffdb;",
sloganCssMobile: "font-size: 32px;"

sloganCssMobile

Type: String

The style for the slogan if a width of the Window <= 500px

Example:

sloganCss: "color: #ffffdb;",
sloganCssMobile: "font-size: 32px;"

topEffects

Type: String

the string of "top" directional effects

Default: "columntop fadetop cubefadetop cubefadetopmin rowtop colfadetopdiamond colfadetopwavy rowfadewavy"

Example:

     topEffects: "colfadetopdiamond colfadetopwavy rowfadewavy"

triggers

Type: Object

the object that contains pairs of events (key) and selectors (value). Required.

Example:

triggers: {
   body: "body",
   click: "a.ajax, a.no-ajax",
   invis: "a.ajax, a.no-ajax"
}

views

Type: Object

the object that is used to define views parameters. You can define as many views as you want in a form of:

views: {

viewName: {params...},

viewName: {params...},

}

Example:

    views: {
      wide: {
        cssClass: "wide",
        loadedEvent: "wide",
        unloadEvent: "end",
        color: "rgb(55,55,55)",
        onContentLoaded: function () {
          $(".wide #img-container").height($(window).height() - 2);
        },
        viewModeString: "ajax=true"
      },
      card: {
        cssClass: "card",
        color: "#8da8bf",
        viewModeString: "ajax=true"
      }
    },

Views properties

Views allow to define different properties for different kinds of content. In other words if you have got content with similar properties you can group it in one view.

If you want to specify that the resource should be loaded with parameters of a certain view you should use a data-view attribute:

                    <a class="employee ajax" href="employee.php?id=1" data-view="card">

color

Type: String

the background color of shutters and openers

Default: rgb(169, 169, 169)

Overrides the general "color" property

Example:

     
      color: "steelblue",
     

content

Type: Selector

Mode: AJAX

the selector of the element (with all child elements) that will be shown when AJAX content is loaded. All other content of the response from the server will be ignored.

Default: "#content"

Overrides the general "content" property

Example:

    views: {
      card: {
        content: "#ajax-content",
        ...
        },
      ...
      },

cssClass

Type: String

the class, that will be added to the "#pm-fixed" element (the root element of Magic LightBox)

Default: the name of the view

Example:

    views: {
      card: {
        cssClass: "staff-card",
        ...
        },
      ...
      },

effect

Type: String

the name of the effect for this view. If it is defined, only this effect will be used.

Example:

    views: {
      card: {
        effect: "fadetop",
        ...
        },
      ...
      },

fullscreen

Type: Boolean

Mode: image

if the value is true the native fullscreen support is switched on

Default: false

Example:

      aivazovsky: {
        mode: "image",
        fullscreen: true,
      },

Type: Selector

Mode: image

the selector of the element that contains all images of the gallery. If this property is defined Magic LightBox works in an image mode but with some additional features: buttons "back" and "forward", keyboard events support, mousewheel events support, swipe event support.

Example:

      gallery: {
        mode: "image",
        gallery: "#aivazovsky",
        sloganCss: "opacity: 0.7",
        play: true,
        fullscreen: true,
        isHistory: false,
        pause: 1
      },

imageCss

Type: String

The style for the background image.

if you want an image to be included to animation as a background you should define this parameter.

Example:

 imageCss: "background-image: url(images/gallery/info-bg.png); background-repeat: repeat;"

imageCssMobile

Type: String

The style for the background image that will be applied if a width of the Window <= 500px

Example:

 imageCss: "background-image: url(images/gallery/info-bg-1.png); background-repeat: repeat;"

isDirection

Type: Boolean

Mode: image

if the value is true directional effects will be applied

Example:

      image_gallery: {
        mode: "image",
        gallery: "#images-gallery",
        isDirection: true
      },

isHistory

Type: Boolean

if the value is true the native browser history support is switched on

Default: true

Example:

      views: {
        card: {
          isHistory: false,
          ...
        },
        ...
      },

loadedEvent

Type: String

the custom event that will be fired when the content is loaded to the lightBox

Default: the name of the view

Example:

$(document).ready(function () {
    var options = {
      triggers: {
        click: "a.ajax"
      },
      views: {
        card: {
        //empty object
        //the name of the event will be the default value ("card")
        }
      }
    };
    MagicLightBox(options);
    $(document).on("card", function () {
     
      alert("event card is fired!");
     
    });
  }

mode

Type: String

if the value is "image", the image mode is switched on, otherwise the image mode is switched off

Example:

      image_gallery: {
        mode: "image",
        gallery: "#images-gallery",
        isDirection: true
      },

onContentLoaded

Type: Function

the function that should be executed when the content is loaded to the LightBox

Example:

   
    onContentLoaded: function () {
      $(document).trigger("loaded");
    },
   

onContentUnload

Type: Function

the function that should be executed when the content is being removed from the lightBox

Example:

      views: {
        card: {
          onContentUnload: function(){
            alert("unload");
            //or do something useful
          },
          ...
        },

pause

Type: Integer

Mode: image

time in seconds during which the image is displayed when a slideshow has been switched on

Example:

gallery_inline: {
   mode: "image",
   gallery: "#element8",
   play: true,
   pause: 1
},

play

Type: Boolean

This property adds the possibility of a slideshow

Default: false

Example:

gallery_inline: {
   mode: "image",
   gallery: "#element8",
   play: true,
   pause: 1
},

slogan

Type: String

the text that will be shown as a slogan

Overrides the general "slogan" property.

Example:

      views: {
        card: {
          slogan: "Good Day!"
          },
          ...
        },

sloganCss

Type: String

The style for the slogan

Example:

sloganCss: "color: #ffffdb;",
sloganCssMobile: "font-size: 32px;"

sloganCssMobile

Type: String

The style for the slogan if a width of the Window <= 500px

sloganCss: "color: #ffffdb;",
sloganCssMobile: "font-size: 32px;"

unloadEvent

Type: String

the custom event that will be fired before the content is removed from the lightBox panel

Example:

      views: {
        card: {
          unloadEvent: "cardUnloadEvent"
          },
          ...
        },

viewModeString

Type: String

the string that must be added to the url to notify the server that it is an ajax request

Example:

      views: {
        card: {
          viewModeString: "ajax=true"
          },
          ...
        },

Markup

attributedescription
data–color

the background color of shutters and openers.

Default: rgb(169, 169, 169)

Example:

<p class="but-p">
    <a class="btn btn-primary btn-lg no-ajax"
       href="" role="button"
       data-color="gray"
       data-element ="#element"
       >Choose Your Effect!</a>
</p>
data–content

the selector of the element (with all child elements) that will be shown when AJAX content is loaded. All other content of the response from the server will be ignored.

Default: "#content"

Overrides general and view "content" properties.

Example:

<p class="but-p">
   <a href="staff/employee.php?id=1&tab=send"
      class="btn btn-default ajax"
      data-view="card"
      data-content="#ajax-content"
      >Go!</a>
</p>
data–css–class

the class, that will be added to the "#pm-fixed" element (the root element of Magic LightBox)

Example:

Default: the name of the view

<p class="but-p">
    <a href=""
       class="no-ajax btn btn-default"
       data-element="#element8"
       data-view="gallery_items"
       data-css-class="black"
       >Go!</a>
</p>
data–direction

If it is defined, the direction of directional effects.

Example:

<p class="but-p">
   <a href=""
      class="no-ajax btn btn-default"
      data-element="#element8"
      data-view="gallery_items"
      data-direction="top"
      >Go!</a>
</p>
data–effect

the name of the effect.

Example:

<p class="but-p">
   <a href=""
      class="no-ajax btn btn-default"
      data-element="#element8"
      data-view="gallery_items"
      data-effect="fadetop"
      >Go!</a>
</p>
data–effects

if this attribute has a value "no", the function "link" will be applied instead of "show", i.e. if the lightBox panel is opened, another ajax content will be loaded, but no effects will be used and no changes in the window.history will be made as well. If the lightBox panel is not opened, the "link" function will open it and load the ajax content but won't make changes in the window.history. This attribute can belong to elements that defined in the "triggers" object.

Example:

      <a href="index.php?sort=name" data-view="table" data-effects="no" class="ajax">Sort by name</a>

data–element

The selector of an element. If this attribute is defined the lightBox works in "html" mode. The content of the lightBox will be replaced by the defined element.

Example:

<p class="but-p">
   <a href=""
      class="no-ajax btn btn-default"
      data-element="#element8"
      data-view="gallery_items"
      >Go!</a>
</p>
data–history

if the value is "true" or "True" or "TRUE", the native browser history support is switched on, otherwise the native browser history support is switched off.

Default: "true"

Overrides the view "isHistory" property.

Example:

<p class="but-p">
   <a href=""
      class="no-ajax btn btn-default"
      data-history="TRUE"
      data-view="gallery_items"
      >Go!</a>
</p>
data–href

defines an URL of the resource. If it is not defined, the value of the "href" attribute will be taken instead.

Example:

<a href="https://www.flickr.com/photos/hugo_poon/11946102783"
   title="my &quot;little room&quot; by hugo poon, on Flickr"
   data-href="https://farm4.staticflickr.com/3777/11946102783_4a61a8740c_o.jpg"
   class="no-ajax"
   data-view="image_gallery"
   >
  ...
</a>
data–image–css

The style for the background image.

If you want an image to be included to animation as a background you should define this parameter.

Example:

<a href="images/gallery/forest2.jpg"  class="no-ajax"
   data-view="image_base"
   data-image-css = "background-image: url(images/gallery/forest-vangogh.jpg) "
   >
   ...
 </a>
data–image–css–mobile

The style for the background image that will be applied if a width of the Window <= 500px

Example:

<a href="images/gallery/forest2.jpg"  class="no-ajax"
   data-view="image_base"
   data-image-css = "background-image: url(images/gallery/forest-vangogh.jpg)"
   data-image-css-mobile = "background-image: url(images/gallery/forest-compact.jpg)"
   >
   ...
 </a>
data–loaded–event

the custom event that will be fired when the content is loaded to the lightBox.

Example:

<a href="images/gallery/forest2.jpg"  class="no-ajax"
   data-view="image_base"
   data-loaded-event= "baseLoaded"
   >
   ...
 </a>
data–slogan

the text that will be shown as a slogan.

Overrides general and view "slogan" properties.

Example:

<a href="images/gallery/forest2.jpg"  class="no-ajax"
   data-view="image_base"
   data-slogan= "Magic LightBox"
   >
   ...
 </a>
data–slogan–css

The style for the slogan

Example:

<a href="images/gallery/forest2.jpg"  class="no-ajax"
   data-view="image_base"
   data-slogan-css= "font-size: 100px;"
   >
   ...
 </a>
data–slogan–css–mobile

The style for the slogan if a width of the Window <= 500px

Example:

<a href="images/gallery/forest2.jpg"  class="no-ajax"
   data-view="image_base"
   data-slogan-css= "font-size: 100px;"
   data-slogan-css-mobile= "font-size: 50px;"
   >
   ...
 </a>
data–unload–event

the custom event that will be fired before the content is removed from the lightBox panel.

Example:

<a href="images/gallery/forest2.jpg"  class="no-ajax"
   data-view="image_base"
   data-unload-event= "baseUnload"
   >
   ...
 </a>
data–view

defines the name of the view. This attribute can belong to elements that defined in the "triggers" object.

Example:

<a href="images/gallery/forest2.jpg"  class="no-ajax"
   data-view="image_base"
   >
   ...
 </a>
data–viewer–bottom–menu

The selector of the element that must be loaded to the bottom menu. This attribute is applicable for the "image" mode only.

Example:

                <a href="https://www.flickr.com/photos/bryaniceman/16447060430"
                   title="Sydney Harbour by Bryan Leung, on Flickr"
                   class="no-ajax"
                   data-href="https://farm9.staticflickr.com/8616/16447060430_d964ee5dc6_h.jpg"
                   data-view="inline_gallery"
                   data-viewer-bottom-menu ='#element11'                    
                   >
                    ...
                </a>
data–viewer–title

The text that will be the bottom caption. This attribute is applicable for the "image" mode only.

Example:

                <a href="https://www.flickr.com/photos/bryaniceman/16447060430"
                   title="Sydney Harbour by Bryan Leung, on Flickr"
                   class="no-ajax"
                   data-href="https://farm9.staticflickr.com/8616/16447060430_d964ee5dc6_h.jpg"
                   data-view="inline_gallery"
                   data-viewer-title = 'Sydney Harbour by Bryan Leung'
                   data-viewer-top-menu ='#element9'                    
                   >
                    ...
                </a>
data–viewer–top–menu

The selector of the element that must be loaded to the top menu. This attribute is applicable for the "image" mode only.

Example:

                <a href="https://www.flickr.com/photos/bryaniceman/16447060430"
                   title="Sydney Harbour by Bryan Leung, on Flickr"
                   class="no-ajax"
                   data-href="https://farm9.staticflickr.com/8616/16447060430_d964ee5dc6_h.jpg"
                   data-view="inline_gallery"
                   data-viewer-title = 'Sydney Harbour by Bryan Leung'
                   data-viewer-top-menu ='#element9'                    
                   >
                    ...
                </a>

Magic LightBox methods

Methods

show(href, push, view, data) — shows the Magic LightBox panel and loads the content

parameters:

href — {Object} a Href object. By means of the Href Object you can transfer all necessary properties into the method. The Href Object may contain keys: href (analog of the data-href attribute), view (data-view), color (data-color), slogan (data-slogan), imageCss (data-image-css), sloganCss (data-slogan-css), imageCssMobile (data-image-css-mobile), sloganCssMobile (data-slogan-css-mobile), history (data-history), cssClass (data-css-class), loadedEvent (data-loaded-event), unloadEvent (data-unload-event), viewModeString (data-view-mode-string), content (data-content), direction (data-direction), effect (data-effect), element (data-element), viewerTitle (data-viewer-title), viewerBottomMenu (data-viewer-menu-bottom), viewerTopMenu (data-viewer-menu-top).

push — {boolean} if the value is true, the window.history.pushState method will be applied

data — {Object} or {String} custom data that will be added to the request

if {Object} — a POST request method will be applied

if {String} — a GET request method will be applied

Example:

function sendMail(event) {
   event.preventDefault();
   lb.show({
      href: "staff/employee.php",
      view: "card",
      slogan: "e",
      sloganCss: "font-family: 'staff'; font-size: 200px;",
      sloganCssMobile: "font-family: 'staff'; font-size: 100px;",
      imageCss: "background-image: url(images/bg.png); background-repeat: repeat;",
      effect: "fadeleft"
       }, false, $(this).serializeArray());
  }

open() — opens a current url in the browser

Example:

lb.open();

hide() — hides the Magoc LightBox panel

Example:

lb.hide();

href — {Object} a Href object. By means of the Href Object you can transfer all necessary properties into the method. The Href Object may contain keys: href (analog of the data-href attribute), view (data-view), color (data-color), slogan (data-slogan), imageCss (data-image-css), sloganCss (data-slogan-css), imageCssMobile (data-image-css-mobile), sloganCssMobile (data-slogan-css-mobile), history (data-history), cssClass (data-css-class), loadedEvent (data-loaded-event), unloadEvent (data-unload-event), viewModeString (data-view-mode-string), content (data-content), direction (data-direction), effect (data-effect), element (data-element), viewerTitle (data-viewer-title), viewerBottomMenu (data-viewer-menu-bottom), viewerTopMenu (data-viewer-menu-top).

Example:

lb.link({
  href: "staff/table.php?y=2014&id=8",
  view: "table"
});

getStatus() — Returns true if the lightBox panel is opened.

Example:

if(lb.getStatus()) lb.hide();

getIndex() — Returns the current index of the picture in the gallery.

Example:

var index = lb.getIndex(),
items = $("#images-gallery a.no-ajax"),
item = items[index];

go(strItems, strGallery, intIndex) — This method is used to open an element of the gallery from the script.

strItems — {String} Selector of items in the gallery

strGallery {String} Selector of the gallery. Default "body"

intIndex — {Integer} index of the element to be opened. Default 0

Example:

 lb.go(".no-ajax", "#images-gallery", index);

Events

General events

eventdescription
contentLoaded is fired when content is loaded to the lightBox
ajaxError is fired on ajax error in an ajax mode only
loaderHidden is fired when the lightBox panel has been opend
openerEnd is fired when animation of openers finished
shutterEnd is fired when animation of shutters finished
close is fired when the lightBox panel is closed

Custom events

"View" levelMarkup levelDescription
loadedEvent data-loaded-event the custom event that will be fired when the content has been loaded to the lightBox
unloadEvent data-unload-event the custom event that will be fired before the content is removed from the lightBox

On the "view" level the default value of the loaded event is the name of the view.

An event specified by markup doesn't override an event specified on the "view" level. Both events will be fired.