-
How do I get slide captions to always appear overlayed on top of the slide image (just above the bottom of the image) instead of appearing below the image? |
Beta Was this translation helpful? Give feedback.
Answered by
fancyapps
Sep 4, 2025
Replies: 1 comment 1 reply
-
Hi, The answer is - yes and no. There is no option for that, but you can place any HTML content over the image. <a
href="https://lipsum.app/id/1/1600x1200"
data-fancybox="gallery"
data-title="Optional title,<br />that can contain <em>HTML</em> code"
>
<img src="https://lipsum.app/id/1/200x150" width="200" height="150" alt="" />
</a> Fancybox.bind("[data-fancybox]", {
zoomEffect: false,
on: {
"Carousel.contentReady": (_fancybox, _carousel, slide) => {
if (slide.title) {
slide.panzoomRef
?.getViewport()
?.insertAdjacentHTML(
"beforeend",
`<div style="position:absolute;left:0;right:0;bottom:0;color:#fff;background:rgba(0,0,0,0.2);padding:20px;">${slide.title}</div>`,
)
}
},
},
}); |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
dmcrlsn
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
The answer is - yes and no. There is no option for that, but you can place any HTML content over the image.
Here is an example that is using custom attribute for links: