The documentation is flipped – allowMediaOverlap of true allows the captions to overlap, not the other way round. If you look at the demos, take a look at the demo for “Static thumbnails”, or “Customize more”, both of which set allowMediaOverlap: true. The default setting is false, so overlapping shouldn’t be happening by default.
If you are seeing an overlap, please provide me with a URL, and I can take a look.
Hi Sayontan,
Sorry for the very late reply. I haven’t been able to revisit this until now.
This was a bit of a confusing situation to figure out, but here’s what I’ve determined:
When using the LightGallery lightbox, the initial height of the image depends on the presence of a caption.
- If I launch the lightbox from an image thumbnail that has a caption, then the full-size image is vertically centered and the caption is below the image. This is good.
- However, if I launch the lightbox from an image thumbnail having no caption, then the full-size image is initially enlarged to occupy the bottom of the screen where the caption would be. When I then navigate within the lightbox to an image with a caption, then the caption is positioned on the image, instead of below it. The problem is that the image isn’t being subsequently resized to allow space for the caption to be positioned below it.
The problem seems to be in the LightGallery library. I have been able to solve the problem locally by adding the following custom CSS to force the space allocated to the caption to always have a height:
.lg-outer .lg-empty-html.lg-sub-html, .lg-outer .lg-empty-html .lg-sub-html {
display: block;
height: 50px;
}
Now the full-size image in the lightbox is always at the correct height to allow a caption, whether there is one present or not, to work around the lack of image resizing code in the library. Of course this might only work for single unwrapped lines of captions, but that’s better than my current situation.
Thanks!
Interesting… thank you for the update!
I am marking this resolved, but do let me know if you require additional assistance.