Skip to content

datene/lightbox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lightbox

Simple lightbox without nav, check it out

Steps to implement (simple version without nav):

  • Copy the CSS and place it in your project
  • For every image create a lightbox code block, be sure to give it the input a unique id and refer to the id on the label.
  • Specify your image source on the img element.
<div class="lightbox-image">
  <input type="checkbox" id="lightbox-1" name="lightbox" />
  <label for="lightbox-1">
    <img src="./images/cat.jpg" alt="Loading cat" />
  </label>
</div>

How it works

All the images have a checkbox input and when the check box is checked the image in the label expands. When an images is clicked again it toggles the checkbox off

You want nav? We got nav. Just need a tiny bit of JS

Simple lightbox with nav, check it out

<div class="collapsed" id="lightbox-nav">
  <button id="previous">&lsaquo;</button>
  <button id="next">&rsaquo;</button>
</div>

Releases

No releases published

Packages

No packages published