Fullscreen Responsive Gallery Plugin with jQuery - Simple Gallery

Fullscreen Responsive Gallery Plugin with jQuery - Simple Gallery
File Size: 807 KB
Views Total:
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

Simple Gallery is a basic jQuery gallery plugin which enables you to look through a group of images in a responsive, fullscreen lightbox popup.

How to use it:

1. Load the needed jQuery library and jQuery UI in your web page.

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script>

2. Load the jQuery simple gallery plugin after jQuery library.

<script src="SimpleGallery.js"></script>

3. Insert a group of image for the lightbox popup gallery.

<div class="gallery">
  <img src="1.jpg" comment="Image caption 1">
  <img src="2.jpg" comment="Image caption 2">
  <img src="3.jpg" comment="Image caption 3">
  ...
</div>

4. Style the lightbox, overlay and navigation controls via CSS.

#shadow {
  height: 100%;
  width: 100%;
  z-index: 1000;
  background-color: rgba(32, 32, 32, 0.9);
  position: fixed;
  top: 0px;
  left: 0px;
  display: none;
}

#lightbox {
  height: 70%;
  width: 70%;
  overflow: auto;
  z-index: 1001;
  display: none;
  position: fixed;
  margin-left: auto;
  margin-right: auto;
  top: 10%;
  left: 15%;
}

#close-button {
  size: 1.2em;
  text-align: center;
  vertical-align: middle;
  height: 1.25em;
  cursor: pointer;
  color: white;
  background-color: rgba(100, 100, 100, 0.9);
  border-bottom-right-radius: 5px;
  border-bottom-left-radius: 5px;
}

#img-note {
  background-color: rgba(256, 256, 256, 0.75);
  width: 58%;
  height: 8%;
  display: none;
  position: fixed;
  bottom: 5%;
  left: 20%;
  padding: 0 1% 0 1%;
  overflow-x: auto;
}

#img-cont {
  max-height: 100%;
  background-color: rgba(0, 0, 0, 1);
}

#img-cont img {
  max-height: 100%;
  max-width: 100%;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

#img-next,
#img-prev {
  height: 3em;
  width: 3em;
  position: fixed;
  bottom: 6%;
  text-align: center;
  cursor: pointer;
  line-height: 2.75em;
  color: #fff;
}

#img-next img,
#img-prev img {
  max-height: 3em;
  max-width: 3em;
}

#img-next { right: 10%; }

#img-prev { left: 10%; }

#img-close {
  position: fixed;
  top: 2%;
  right: 2%;
  cursor: pointer;
  color: #fff;
  font-size: 2em;
  height: 3em;
  width: 3em;
  font-family: consolas;
}

4. Initialize the plugin and done.

$('.gallery').SimpleGallery();

5. Available settings.

$('.gallery').SimpleGallery({
height: '500px',
width: '100%',
nextImage: "",
prevImage: "",
closeImage: ""
});

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