diff --git a/docs/assets/js/custom.js b/docs/assets/js/custom.js index fdce47d..7204209 100644 --- a/docs/assets/js/custom.js +++ b/docs/assets/js/custom.js @@ -95,11 +95,34 @@ $(document).ready(function () { .clone() .removeClass("step-thumb") .addClass("step-picture") + .addClass("lightbox") .insertBefore($(this).parent()); /* Make the first thumbnail active by default */ $(this).addClass("active"); }) + + let imageGroups = [] + $(".lightbox").each(function () { + let imageSource = $(this).attr('src') + let imageAlt = $(this).attr('alt').replace(/ /g,"") + let imageTitle = $(this).attr('alt') + if (imageTitle) { + imageTitle = 'title="' + imageTitle + '" ' + } else { + imageTitle = '' + } + $(this). + wrap('') + imageGroups.push('.' + imageAlt) + }) + jQuery.unique(imageGroups) + imageGroups.forEach(imageGroupsSet) + + function imageGroupsSet (value) { + $(value).simpleLightbox() + } }) /* Attach a delegate function on mouse over thumbnail to change the