Jump to content

Gallery Grid Block Hover Effect - Title & Color Shift - 7.0?

Recommended Posts

Posted

Hi! I'm looking to add custom css so that in my gallery grid block the title of the image appears on hover with a slight color overlay (white text, greyed out image), instead of the title appearing below. I need to make sure that the click through links still work, and that on a mobile site where there isn't "hover" the title is just always visible. Any help would be very appreciated! I can only find code for 7.1...

Posted
18 hours ago, AWolf said:

Hi! I'm looking to add custom css so that in my gallery grid block the title of the image appears on hover with a slight color overlay (white text, greyed out image), instead of the title appearing below. I need to make sure that the click through links still work, and that on a mobile site where there isn't "hover" the title is just always visible. Any help would be very appreciated! I can only find code for 7.1...

Can you share your site with the protected password so I can take a look?

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox - PDF Lightbox popup - ...) </>  🗓️ Delivery Date Picker (Date picker form field)
Gallery block 7.1 workaround </> No-code customisations for Squarespace

Posted
On 12/28/2022 at 12:02 AM, AWolf said:

Sorry not sure what you mean by "protected password" but the test page I made to try this with is: http://www.alexawolf.com/narrative-test

Thank you for the help!

Add to Design > Custom CSS

/* .slide hover */
.slide a:after {
    content: "";
    display: block;
    background: rgb(128, 0, 128, 0.5);
    position: absolute;
    top: 0;
    left: 0;
    z-index: 999;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s;
}
.slide:hover a:after {
    opacity: 1;
    transition: all 0.3s;
}
/* Show overlay on hover */
.slide:hover .image-slide-title {
	opacity: 1;
}
/* move title over overlay + hide it initial */
.image-slide-title {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    width: 70%;
    text-align: center;
    color: white;
    opacity: 0;
    z-index: 1000;
    transition: all 0.5s;
    pointer-events: none;
    white-space: initial !important;
}

 

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.