VictoriaMacLellan Posted March 25, 2021 Share Posted March 25, 2021 Site URL: https://pear-sponge-56w4.squarespace.com/recarpet/event Hello, I would like to add an overlay caption when hovering over images in a gallery. I found the code to do this, it worked great but it disabled the lightbox function so the images couldn't be enlarged. Would anyone be able to help take a look at the code to see how to keep the lightbox function working? Thank you appreciate any help! CODE: .gallery-caption { position: absolute; top: 0; left: 0; background: rgba(0,0,0,0.4); /* overlay color */ height: 100%; max-width: unset; padding: 0; opacity: 0; } .gallery-caption-wrapper { display: flex; align-items: center; /* center vertically */ justify-content: center; /* center horizontally */ } .gallery-caption-content { font-size: 1rem !important; /* caption font size */ color: white; /*caption font color */ } .gallery-grid-item { position: relative; } .gallery-grid-item:hover .gallery-caption { opacity: 1; } .gallery-caption-grid-simple { transition-delay: 0ms; } Link to comment
tuanphan Posted March 29, 2021 Share Posted March 29, 2021 Try adding pointer-events: none to this code .gallery-caption { position: absolute; top: 0; left: 0; background: rgba(0,0,0,0.4); /* overlay color */ height: 100%; max-width: unset; padding: 0; opacity: 0; pointer-events: none; /* enable clickable */ } Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.