Skip to content

Instantly share code, notes, and snippets.

View LeffeBakedBird's full-sized avatar

Lefteris Psitopoulos LeffeBakedBird

  • Thanpa
  • Drama, Greece
View GitHub Profile
// the lightbox functionality
$('.gallery-img-holder').on('click', function() {
var ClickedImgSrc = $(this).children('img').attr('src');
var theLightboxImage = $('.lightbox>.img-container>img');
theLightboxImage.attr('src', ClickedImgSrc);
$('.lightbox .close-btn').css('left', theLightboxImage.width()/2);
$('.lightbox').addClass('open');
});
// close the lightbox
@LeffeBakedBird
LeffeBakedBird / lightbox.css
Created June 21, 2017 14:20
the css for the gallery lightbox
.lightbox {
display: table;
position: fixed;
top: 0;
background: rgba(0, 0, 0, 0.49);
height: 100%;
width: 100%;
opacity: 0;
visibility: hidden;
transition: .1s all ease-in;
@LeffeBakedBird
LeffeBakedBird / lightbox.html
Last active June 21, 2017 14:08
Lightbox for the gallery
<div class="lightbox">
<div class="img-container">
<span class="glyphicon glyphicon-remove close-btn"></span>
<img src="" class="img-responsive thumbnail" />
</div>
</div>
<div class="row mtb-20">
<div class="col-xs-12">
<ul class="nav nav-pills gallery-filters">
<li role="presentation"><a href="#">All</a></li>
<li role="presentation"><a href="#">Houses</a></li>
<li role="presentation"><a href="#">People</a></li>
<li role="presentation"><a href="#">Animals</a></li>
<li role="presentation"><a href="#">Places</a></li>
</ul>
</div>