Description in popup only when hovering

Hello! Would there be a possibility to create a CSS to make the popup in the photo gallery widget display the description of a photo exactly as in the carousel, i.e. the description would only appear on hover and with the photo darked out?

Thanks in advance for any help.

Hey there and welcome to the Community, @Cary :waving_hand:

Yep, I guess it’s feasible. Please let me consult with the devs, I’ll get back to you once I have their response :slightly_smiling_face:

Thank you for waiting!

To display the description on hover in the popup, you should follow these steps:

  1. Enable description for the popup in the Popup Settings section:


  1. Add the code below to the Custom CSS section on the Style tab of your widget’s settings:
.fslightbox-container .fslightbox-caption-description {
  opacity: 0 !important;
  pointer-events: none;
  transition: opacity .3s ease;
}
.fslightbox-container:has(.fslightbox-single-source:hover) .fslightbox-caption-description {
  opacity: 1 !important;
}
.fslightbox-container .fslightbox-single-source {
  transition: filter .3s ease;
}
.fslightbox-container .fslightbox-single-source:hover {
  filter: brightness(.5);
}

  1. Change the text color in the popup, since the white color won’t be visible for some photos on mobile devices:


Give it a shot and let me know if you like the result :wink:

Hello Max,
thank you for the script.
It works well on desktop, but not so well on mobiles. I’m not even talking about the text color, which I’ve set to red for testing, but more of the placement of the text. Again, it’s fine for a desktop screen, but not for my page where the widgets reside: https://guitar.lu/polgreisch.htm The widget with the code you supplied is the 5th on the page. My page is not specially made for mobile devices, and I understand the problem might come from there.

I wonder if an other solution would be possible: placing the description text just below the photo in the popup - without the hovering thing (it would not be necessary then).

Thx again for your help,
Cary

Hi @Cary :waving_hand:

Do you mean to display the text below image in the popup on mobile only or on desktop as well?

on mobile and desktop

Got you, thanks!

I’ve forwarded your request to the devs and will let you know once the solution is ready :slightly_smiling_face:

Hi there, @Cary :waving_hand:

Please try to use this CSS code instead and let me know if it helped :slightly_smiling_face:

I’d love to… ,but I guess you forgot to post the code ?!:grin:

I am sorry, my bad :sweat_smile:

Here is the code:

.fslightbox-caption-wrapper {
  bottom: 90px !important;
}

.fslightbox-single-source {
  max-height: calc(100vh - 220px) !important;
}

Looks good now, thank you so much!

Great, you’re very welcome :wink: