holahannah Posted October 11 Share Posted October 11 Hello, I'm trying to display captions on hover (on hover only) for a gallery wihth a Masonry layout. https://formedgardens.squarespace.com/projects password: fg I'm using the following code: section[data-section-id="6526275e7a97df2f9d881199"] .gallery-caption-grid-masonry h4 { margin-bottom: 0; text-align: center; } //Overlay Style // section[data-section-id="6526275e7a97df2f9d881199"] .gallery-caption-grid-masonry { max-width: 100%; padding: 20px; pointer-events: none; position: absolute; bottom: 30%; width: 100%; } //Hover Mode // section[data-section-id="6526275e7a97df2f9d881199"] .gallery-masonry-item:hover { opacity: 0.5; } It's getting the caption where I want it, however, i DON'T want the caption to display unless you hover over the image thumbnail. Does anyone know what CSS I can use to achieve this? So the normal thumbnail state should just show the image, and then when you hover, you should be able to see the caption and the image should be faded out. Like the attached screenshot. Thank you 🙂 Link to comment
Ziggy Posted October 11 Share Posted October 11 Change the CSS to this, I've added an opacity of zero and a hover to change the opacity, hopefully that works. section[data-section-id="6526275e7a97df2f9d881199"] .gallery-caption-grid-masonry h4 { margin-bottom: 0; text-align: center; transition:ease-in-out 300ms; } //Overlay Style // section[data-section-id="6526275e7a97df2f9d881199"] .gallery-caption-grid-masonry { max-width: 100%; padding: 20px; pointer-events: none; position: absolute; bottom: 30%; width: 100%; opacity:0; transition:ease-in-out 300ms; } //Hover Mode // section[data-section-id="6526275e7a97df2f9d881199"] .gallery-masonry-item:hover { opacity: 0.5; .gallery-caption-grid-masonry { opacity:1; } } Please like and upvote if my comments were helpful to you. Cheers! Zygmunt Spray Squarespace Website Designer Contact me: https://squarefortytwo.com 🔌 Ghost Squarespace Plugins (Referral link) 📈 SEO Space (Referral link) ⬛ SquareWebsites Plugins (Referral link) ✨ Spark Plugin (Referral link) ☕ Did I help? Buy me a coffee? Link to comment
holahannah Posted October 12 Author Share Posted October 12 Hi @Ziggy, Thank you! That seems to do the trick, however the caption text also seems to have an opacity applied when you hover. Is there a way to only have the image with a 0.5 opacity, and the text no opacity at all? Appreciate it! 🙂 Link to comment
Ziggy Posted October 12 Share Posted October 12 I can't actually see where the text opacity is coming from, it looks wrong but I can't see why in the code. Please like and upvote if my comments were helpful to you. Cheers! Zygmunt Spray Squarespace Website Designer Contact me: https://squarefortytwo.com 🔌 Ghost Squarespace Plugins (Referral link) 📈 SEO Space (Referral link) ⬛ SquareWebsites Plugins (Referral link) ✨ Spark Plugin (Referral link) ☕ Did I help? Buy me a coffee? Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment