У меня была аналогичная ситуация, когда мне нужно было отображать подписи с фотографиями и мои собственные данные. Я создал свою собственную боковую панель и наложил ее поверх галереи, но у меня были проблемы с высотой. Поэтому я использовал макет галереи, вставив боковую панель в галерею.
Вот что я сделал, я создал свою боковую панель и добавил ее в тело, и спрятал ее, затем, когда откроется галерея, я ее клонировал и вставлял в галерею. Когда галерея закрывается, я уничтожаю ее и вызываю ее снова, когда галерея открывается снова. Я также скрываю заголовки по умолчанию и записываю их на боковой панели после каждого перехода слайдов.
Посмотрите на lightGallery API Events, без них это будет невозможно.
HTML
// My own sidebar element, I added this just before the closing Body tag, it is hidden via CSS
<div class="gallery-info-box">
<div class="slide-caption-wrap">
// Photo captions will be populated here
</div>
// include advert
// include comments
</div>
CSS
// Push Gallery objects 420px to the right so the controls wont be covered by the sidebar
.lg-admin-wrap,
.lg-outer .lg-video-cont,
.lg-outer .lg-thumb-outer,
.lg-thumb-open .lg-toogle-thumb,
.lg-outer .lg-toogle-thumb,
.lg-toolbar.group
@media (min-width: 768px)
padding-right: 420px
.lg-actions .lg-next
@media (min-width: 768px)
margin-right: 420px
// Position and style gallery sidebar
.gallery-info-box
display: none
.lg
.gallery-info-box
display: block
position: absolute
z-index: 1080
top: 0
right: 0
width: 400px
height: 100%
padding: 20px
background-color: white
@media (max-width: 767px)
display: none
.slide-caption-wrap
h4
margin-top: 0
font-size: 24px
JS
var $lg = $('#light-gallery');
// Perform any action just before opening the gallery
$lg.on('onAfterOpen.lg',function(event){
// Hide the original comments
$('.lg-sub-html').hide();
// Insert sidebar into the gallery
$('.gallery-info-box').clone().appendTo('.lg').show();
});
// Perform any action after the slide has been loaded
$lg.on('onAfterAppendSubHtml.lg',function(event){
var lgSubContent = $('.lg-sub-html').html();
// Populate the sidebar with the captions
$('.lg .slide-caption-wrap').html(lgSubContent);
});
// Perform any action just after closing the gallery
$lg.on('onCloseAfter.lg',function(event){
// Remove the gallery sidebar
$('.lg .gallery-info-box').remove();
});
Я сейчас делаю то же самое, приятель. Пока не повезло. Дайте мне знать, если вы ее взломали. –