Lightweight Multimedia Modal Plugin with jQuery - inLarge

File Size: 5.16 KB
Views Total: 837
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   
Lightweight Multimedia Modal Plugin with jQuery - inLarge

inLarge is a lightweight, flexible jQuery lightbox plugin for creating responsive, fullscreen modal windows to display your images, videos, iframes and other multimedia content.

Basic usage:

1. Load jQuery JavaScript library and the jQuery inLarge plugin at the end of the html page.

<script src="/path/to/jquery.min.js"></script>
<script src="/path/to/inLarge.min.js"></script>

2. Create a normal image lightbox.

<img class="inlarge" src="1.jpg">

3. Create an Youtube Video lightbox using the data-iframe attribute.

<img class="inlarge" data-iframe="https://www.youtube.com/embed/Hv_DRJZZ2qI" src="placeholder.jpg">

4. Initialize the lightbox plugin.

$('.inlarge').inLarge();

5. Apply your own styles to the lightbox.

.inlarge { cursor: pointer; }

#inlarge-container {
  background-color: #000;
  background-color: rgba(0, 0, 0, .8);
  display: none;
  height: 100%;
  left: 0;
  overflow: auto;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
}

#inlarge-close {
  color: #fff;
  font-size: 20px;
  font-family: Helvetica, Arial, Verdana;
  position: fixed;
  right: 12px;
  text-decoration: none;
  top: 10px;
  z-index: 1001;
}

#inlarge-wrapper {
  display: table;
  height: 100%;
  table-layout: fixed;
  width: 100%;
}

#inlarge-inside {
  display: table-cell;
  height: 100%;
  vertical-align: middle;
}

#inlarge-inside img, #inlarge-inside iframe {
  display: block;
  margin: 0 auto;
  max-height: 100%;
}

#inlarge-inside iframe { width: 100%; }

6. Set your prefered options to customize the lightbox.

$('.inlarge').inLarge({

  // animation speed
  speed : 1000,

  // auto play videos
  autoplay : false,

  // max width of the lightbox
  max_width : '100%',

  // press the ESC key to close the lightbox
  esc_close : true

});

This awesome jQuery plugin is developed by justinarmstrongcreat. For more Advanced Usages, please check the demo page or visit the official website.