A simple, lightweight Lightbox script, using pure JavaScript, no frameworks required.
JavaScript CSS HTML
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
exampleimages
lightbox
.gitattributes
.gitignore
README.md
index.html

README.md

Lightbox

A simple, lightweight Lightbox script, using pure JavaScript, no frameworks required.

A Remi A Olsen Production :D remi@remiolsen.info / https://remiolsen.info

Demo: https://remiolsen.info/lightbox/

This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License: https://creativecommons.org/licenses/by-nc/4.0/

To run, simply add these lines within the head tag:

<script type="text/javascript" src="lightbox/js/lightbox.js"></script>
<link rel="stylesheet" href="lightbox/css/lightbox.css" type="text/css" media="all" />

To link an image to the lightbox:

<a href="exampleimages/1.jpg" title="View full image" class="lightbox">Photo of a painter.</a>

With a thumbnail:

<a href="exampleimages/2.jpg" title="View full image" class="lightbox"><img src="exampleimages/2thumb.jpg" alt="Example image"></a>

You can close the Lightbox window by pressing the Escape key on the keyboard. Left and right arrows jump between images.