reference lightbox images with alt tag

Signed-off-by: Michel-FK <michel.stempin@funkey-project.com>
This commit is contained in:
Michel-FK
2021-01-23 19:23:15 +01:00
parent f14ab87c84
commit 59d4c55298
7 changed files with 99 additions and 99 deletions

View File

@@ -2,8 +2,8 @@ $(document).ready(function () {
let imageGroups = []
$(".lightbox").each(function () {
let imageSource = $(this).attr('src')
let imageTag = $(this).attr('tag')
let imageTitle = $(this).attr('title')
let imageAlt = $(this).attr('alt').replace(/ /g,"")
let imageTitle = $(this).attr('alt')
if (imageTitle) {
imageTitle = 'title="' + imageTitle + '" '
}
@@ -11,9 +11,9 @@ $(document).ready(function () {
imageTitle = ''
}
$(this).
wrap('<a class="boxedThumb ' + imageTag + '" ' +
wrap('<a class="boxedThumb ' + imageAlt + '" ' +
imageTitle + 'href="' + imageSource + '"></a>')
imageGroups.push('.' + imageTag)
imageGroups.push('.' + imageAlt)
})
jQuery.unique(imageGroups)
imageGroups.forEach(imageGroupsSet)