Jump to content

Image Block Hover: Zoom + color opacity overlay + text caption

Go to solution Solved by tuanphan,

Recommended Posts

First, add a blank Classic Editor section

classic.png

Next, add an Image Block > Choose Inline Design

image.png.ea681860d6538733d403ebf4cbc13d47.png

Next, add Image Caption and choose this option

image.thumb.png.d6ae263668e87b4c82093c5a54af9ae7.png

image.thumb.png.b28daa42fb6b4400726a3469992d22b8.png

Next, add this code into Design > Custom CSS

figcaption.image-caption-wrapper {
    visibility: hidden !important;
    transition: all 0.3s ease;
  pointer-events: none;
}
.design-layout-inline:hover figcaption.image-caption-wrapper {
    visibility: visible !important;
    max-height: 100% !important;
    height: 100% !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

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

Hi,

I can't seem to get this to work. And noting here that my options look different than the screen shots of the interface you are showing above.

To try to improvise, I chose "Overlay" as the design option since I don't see anything about choosing "Inline" in the image block options.

image.png.7b890b954b3f4dfb3b3fa4259efa871e.png

When I add an image in the content editor for the image block, I don't see an option to add an Image Caption at all. Only the " Alt text". So I tried placing my test copy in the alt text spot in case things have changed:

image.png.ac68e979f6571d1b1ce15fab32e4ddbf.png

 

Then I added your code in Design > CSS and nothing happens after I save. No hover states at all. Plus the color overlay is on the image by default.

Any thoughts on the discrepancy here? Thanks!

JV

 

 

Link to comment

Did some searching and the reason I do not see an option to add a caption (or Inline) is because I am using Fluid Engine /7.1 (mentioned that above).

Word is, I can manually add captions with a text block anywhere I want, which is fine by me, but I need updated code that will hide those until the hover state. I think you place the captions behind the image once you have them where you want them and the code does the rest. But... I need the right cod to achieve this 🙂

JV

Link to comment
  • Solution
On 5/1/2023 at 11:03 PM, Javdesign said:

Hi,

I can't seem to get this to work. And noting here that my options look different than the screen shots of the interface you are showing above.

To try to improvise, I chose "Overlay" as the design option since I don't see anything about choosing "Inline" in the image block options.

image.png.7b890b954b3f4dfb3b3fa4259efa871e.png

When I add an image in the content editor for the image block, I don't see an option to add an Image Caption at all. Only the " Alt text". So I tried placing my test copy in the alt text spot in case things have changed:

image.png.ac68e979f6571d1b1ce15fab32e4ddbf.png

 

Then I added your code in Design > CSS and nothing happens after I save. No hover states at all. Plus the color overlay is on the image by default.

Any thoughts on the discrepancy here? Thanks!

JV

 

 

Please read first step in my comment

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
  • 2 weeks later...
On 5/15/2023 at 10:01 PM, Antknee729 said:

Do you know if it's possible to do this same technique, but instead of the text appearing when you hover over the image, I can make a PNG image appear?

 

You mean

Initial: show image, no text

Hover: show another image, no text

If yes, this is possible, just add an Image block (you can use new editor or classic editor) > Then share link to page where you added an image, we can check and give the code

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

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.