Jump to content

Changing Background Color On Hovering Gallery

Recommended Posts

Posted

Hello, 

I'm currently working on a website for my client. She would like the background color to change upon hovering over a gallery. 

Here's the page I'd like to apply the customization to: https://www.lovelyinlace.me/choose-your-studio-v2

It will be within the homepage index as she's on Squarespace 7.0.

 

Is there a custom CSS code that can change the background color of the page section upon hovering over the second gallery? Really appreciate any help with this, Thanks!

 

joelle-new-headshot.thumb.png.5c6a192361ae2714a9ded64e83cab813.png

circle-member-badge-white.jpg.4d90cb67afb48cac9be6f4818a4cf3ef.jpg

  • Replies 7
  • Views 1.4k
  • Created
  • Last Reply

Top Posters In This Topic

Posted

Hi @tuanphan Yes! When you hover over Gallery 2 (the one with the red arrow), I'd like the white page background to turn to black. Is there a custom code that can achieve this? The client is on Squarespace 7.0 on a Brine family template.

joelle-new-headshot.thumb.png.5c6a192361ae2714a9ded64e83cab813.png

circle-member-badge-white.jpg.4d90cb67afb48cac9be6f4818a4cf3ef.jpg

Posted

The issue here is, I think, if I understand the desired effect, is that there is no way with CSS alone to hover over the gallery and effect the styling of a ancestor element. In this case the element that has the background color.

You would need JavaScript to detect the hover over gallery and then set a class higher up in the chain to get the effect.

This would require the business plan or above and of course the JavaScript code to be written. I know of no code that does this.

 

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

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.