Pure Javascript lightbox with mobile support. It can handle images, videos with autoplay, inline content and iframes
Switch branches/tags
Clone or download
Latest commit 0d7775f Oct 15, 2018



Glightbox is a pure javascript lightbox. It can display images, iframes, inline content and videos with optional autoplay for youtube, vimeo and even self hosted videos with JWPlayer support


You can check the live demo clicking here


$ npm install glightbox
# OR
$ bower install glightbox
import GLightbox from 'glightbox'

Or manually download and link glightbox.min.js in your HTML:

<link rel="stylesheet" href="dist/css/glightbox.css">
<script src="dist/js/glightbox.min.js"></script>

For more information please check the demo site.

Browser Support

GLightbox was tested in the following browsers.

  • Safari
  • Mobile Safari
  • Opera
  • Edge
  • Firefox
  • Internet Explorer 11

It will work in any browser that supports css Flexbox



  • New: You can define each slide option in a different data attribute (data-title="example" data-description="...")
  • Fixed youtube and vimeo autoplay when opened for the first time
  • Fixed global slide params not working
  • Fixed some issues on IE11
  • Fixed using characters : or ; in slide description


  • New: Added reload method, useful when injecting content with ajax, cloning nodes, etc.
  • Fixed closeButton setting not removing the element
  • Fixed video not displayed on mobile devices


  • New: Now you can set individual width and height for each slide with inlines or iframes.
  • New: Now you can set individual source types for each slide ('type': 'image' | 'iframe' | 'video' | 'inline' | 'external).
  • New: Published on npm
  • New: Published on bower
  • Fixed afterSlideLoad only triggered one time for all the slides
  • Fixed a small space between the image and description when is set to top or bottom


  • New: Added none as a new option to disable open, close and slide animations
  • New: Added new options (touchNavigation, keyboardNavigation, closeOnOutsideClick) to enable or disable user interaction
  • Fixed open and close effect not taking a custom animation
  • Fixed an error when calling the destroy method and no videos were present in the slider


  • Improved the open method so it can be called without duplicating the structure and events
  • New: The original node is passed to events like beforeSlideChange, afterSlideChange, etc.


  • New: Added option moreLength to control the number of characters in the description for mobile devices


  • Fixed instance not returned and unable to call public methods


  • Fixed large images not displayed correctly


  • Initial release


  • Improve github description with more documentation and examples


This project is licensed under the MIT License - see the LICENSE.md file for details