mirror of
https://github.com/FunKey-Project/FunKey-Project.github.io.git
synced 2026-03-19 18:32:51 +01:00
add picture lightbox
Signed-off-by: Michel-FK <michel.stempin@funkey-project.com>
This commit is contained in:
24
docs/assets/js/custom.js
Normal file
24
docs/assets/js/custom.js
Normal file
@@ -0,0 +1,24 @@
|
||||
$(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()
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user