Fast Responsive Image Lightbox Plugin - jQuery mobileLightBox

Fast Responsive Image Lightbox Plugin - jQuery mobileLightBox
File Size: 9.85 KB
Views Total:
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

A simple, blazing-fast, mobile-friendly lightbox plugin which displays the full-size version of your image in a responsive modal popup.

Click anywhere on the screen to close the image lightbox.

How to use it:

1. Import the mobileLightBox plugin's files into the webpage which has jQuery library loaded.

<link rel="stylesheet" type="text/css" href="/path/to/mobilelightbox.css">
<script src="/path/to//jquery.min.js"></script>
<script src="/path/to/mobilelightbox.js"></script>

2. Add the CSS class mobileLightBox to the image links as follows:

<a href="https://source.unsplash.com/X6jtULYJQz8/600x450" class="mobileLightBox">
  <img src="https://source.unsplash.com/X6jtULYJQz8/400x300" alt="Image 1">
  </a>

<a href="https://source.unsplash.com/CEGtclvmIII/600x450" class="mobileLightBox">
  <img src="https://source.unsplash.com/CEGtclvmIII/400x300" alt="Image 2">
</a>

<a href="https://source.unsplash.com/crwBSzp6xhk/600x450" class="mobileLightBox">
  <img src="https://source.unsplash.com/crwBSzp6xhk/400x300" alt="Image 3">
</a>

...

3. Call the function mobileLightBox() on document ready and the plugin will do the rest.

$(function(){
  $('.mobileLightBox').mobileLightBox();
});

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