Select Git revision
lightbox.js
Forked from
Stud.IP / Stud.IP
3109 commits behind the upstream repository.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
lightbox.js 788 B
$(document)
.on('click', 'a[href][data-lightbox]', function() {
var gallery = $(this).data().lightbox,
elements = $(this),
images = [],
index = 0;
if (gallery) {
elements = $('a[href][data-lightbox="' + gallery + '"]');
index = elements.index(this);
}
elements.each(function() {
images.push({
src: $(this).attr('href'),
title: $(this).data().title || $(this).attr('title')
});
});
STUDIP.Lightbox.setImages(images);
STUDIP.Lightbox.show(index);
return false;
})
.on('resize', function() {
STUDIP.Lightbox.init();
});
STUDIP.domReady(function () {
STUDIP.Lightbox.init();
});