Jump to content

Captions on Hover - Gallery Masonry Layout

Recommended Posts

Posted

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 🙂 

Screenshot 2023-10-11 at 9.08.11 pm.png

Posted

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 
Hire me on Upwork!

📈 SEO Space (Referral link)
Ⓜ️ 
Will Myers' Plugins & Tutorials (Referral link)
 🔌 Ghost Squarespace Plugins (Referral link)
 SquareWebsites Plugins (Referral link)
 🔲SQSP Themes (Referral link) 
Spark Plugin (Referral link) 
 🖼️Pinch-to-Zoom Gallery Lightbox Plugin (Referral link) 

 Did I help? Buy me a coffee?

Posted

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! 🙂

Posted

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 
Hire me on Upwork!

📈 SEO Space (Referral link)
Ⓜ️ 
Will Myers' Plugins & Tutorials (Referral link)
 🔌 Ghost Squarespace Plugins (Referral link)
 SquareWebsites Plugins (Referral link)
 🔲SQSP Themes (Referral link) 
Spark Plugin (Referral link) 
 🖼️Pinch-to-Zoom Gallery Lightbox Plugin (Referral link) 

 Did I help? Buy me a coffee?

  • 10 months later...
Posted

 

On 10/12/2023 at 8:41 AM, Ziggy said:

I can't actually see where the text opacity is coming from, it looks wrong but I can't see why in the code. 

Hi, I am having the exact same issue with the opacity of captions. How did you manage to fix it in the end so only the image fades out? Thanks!

Posted
On 9/5/2024 at 8:35 PM, KLAstudio said:

 

Hi, I am having the exact same issue with the opacity of captions. How did you manage to fix it in the end so only the image fades out? Thanks!

If you share link to page where you have problem, we can check easier

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!)

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.