Simple Image Gallery with Lightbox Popup jQuery

Simple Image Gallery with Lighbox Popup
Code Snippet:ie8Gallery
Author: Murat Karaca
Published: January 11, 2024
Last Updated: January 22, 2024
Downloads: 4,106
License: MIT
Edit Code online: View on CodePen
Read More

The ie8Gallery is an ultra-small simple image gallery with a lightbox popup. This plugin helps you to create a cross browsers image gallery. It also supports older browsers (IE 8/9/10/11…) to show the images in a lightbox.

How to Create Image Gallery with Lightbox Popup

1. Load the jQuery, ie8Gallery‘s CSS, and JavaScript files into an HTML document.

<!-- jQuery -->
<script src="https://code.jquery.com/jquery-3.4.0.min.js"></script>

<!--ie8Gallery CSS-->
<link rel="stylesheet" type="text/css" href="dist/css/ie8gallery.css">

<!--ie9Gallery JS-->
<script type="text/javascript" src="dist/js/ie8gallery.js"></script>

2. Create a div element that contains the thumbnails of your images. Your thumbnails should have data-img-src attribute that contains the original image size.

<div class="thumbs">
<img class="thumb" src="/thumbnail-url-here.jpg" data-img-src="/original-image-here.jpg" width="200">
---------------------
---------------------
<img class="thumb" src="/thumbnail-url-here.jpg" data-img-src="/original-image-here.jpg" width="200"></div>

3. Initialize the plugin in the jQuery document ready function.

$(document).ready(function(){

   $(".thumbs").ie8Gallery();

});

That’s all! hopefully, you have successfully created an image gallery with a lightbox gallery. If you have any questions or facing any issues, feel free to comment below.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About CodeHim

Free Web Design Code & Scripts - CodeHim is one of the BEST developer websites that provide web designers and developers with a simple way to preview and download a variety of free code & scripts. All codes published on CodeHim are open source, distributed under OSD-compliant license which grants all the rights to use, study, change and share the software in modified and unmodified form. Before publishing, we test and review each code snippet to avoid errors, but we cannot warrant the full correctness of all content. All trademarks, trade names, logos, and icons are the property of their respective owners... find out more...

Please Rel0ad/PressF5 this page if you can't click the download/preview link

X