Michel-FK f14ab87c84 add picture lightbox
Signed-off-by: Michel-FK <michel.stempin@funkey-project.com>
2021-01-23 18:03:13 +01:00

25 lines
644 B
JavaScript

$(document).ready(function () {
let imageGroups = []
$(".lightbox").each(function () {
let imageSource = $(this).attr('src')
let imageTag = $(this).attr('tag')
let imageTitle = $(this).attr('title')
if (imageTitle) {
imageTitle = 'title="' + imageTitle + '" '
}
else {
imageTitle = ''
}
$(this).
wrap('<a class="boxedThumb ' + imageTag + '" ' +
imageTitle + 'href="' + imageSource + '"></a>')
imageGroups.push('.' + imageTag)
})
jQuery.unique(imageGroups)
imageGroups.forEach(imageGroupsSet)
function imageGroupsSet (value) {
$(value).simpleLightbox()
}
})