Buy me a coffee

Squarespace: Change Image on Hover

In this post, I will share how to change image on hover on Squarespace Websites.

Change Product Images on Hover

If you want to change product images on hover, use this plugin. It supports

  • Summary Block (with products)
  • Product Page
  • Product Block

Change Images on Hover (Image Blocks)

Follow the instructions below

1. Add an Image Block

You need to add an Image Block

and upload your image

2. Find Image Block ID

Next you need to determine the ID of the block above. You can use this extension to do.

In this example, we will have an ID:

div#block-yui_3_17_2_1_1577707091631_3805

3. Upload Hover Image

Next you need to upload hover image to your website.

You can follow this guide to upload image.

Assuming the hover image is named img1.jpg, then after uploading it will have the address:

https://cylinder-mackerel-pnk5.squarespace.com/s/img1.jpg

with cylinder-mackerel-pnk5.squarespace.com is your domain.

4. Add CSS code

Add this code to Home > Design > Custom CSS

/* hide image on hover */
  div#block-yui_3_17_2_1_1577707091631_3805 a:hover img {
    opacity: 0;

}
  div#block-yui_3_17_2_1_1577707091631_3805 a img {
    transition: all ease-in-out 0.9s;
    opacity: 1;
  }
/* Set new image */
div#block-yui_3_17_2_1_1577707091631_3805 a {
    background-image: url(https://cdn.pixabay.com/photo/2019/11/19/06/02/seascape-4636549__340.jpg);
    background-size: cover;
    display: block;
}

Replace ID in above code with your image block ID.

Save. Done!

10 thoughts on “Squarespace: Change Image on Hover”

  1. Hi! Thanks so much for posting this. I’m having an issue with this code where the hover image is also the background image for the button and link. Is there any way to exclude the button and link from this code so the hover image only appears for the main image block?

    Thank you! The password to my site is hello.

    Reply
  2. Hi! I used this code but nothing is happening.

    /* hide image on hover */
    div#block-yui_3_17_2_1_1653170827976_4527 a:hover img {
    opacity: 0;

    }
    div#block-yui_3_17_2_1_1653170827976_4527 a img {
    transition: all ease-in-out 0.9s;
    opacity: 1;
    }
    /* Set new image */
    div#block-yui_3_17_2_1_1653170827976_4527 a {
    background-image: url(https://static1.squarespace.com/static/61f075df46f3c55f1b86a95a/t/620abb04ba7af2741996c50b/1644870406518/JRF_1.1.jpg);
    background-size: cover;
    display: block;
    }

    Reply
    • Hi,
      This code should work if you add link for image. If the image has no link, will need a different code. If you share link to page where you have problem, I can check easier

      Reply
        • Depend on your image block.
          You can also add the symbol: # to URL box, and use this CSS to disable link.
          div#block-yui_3_17_2_1_1577707091631_3805 a {pointer-events: none;}

          Reply

Leave a Reply to Tuan Phan Cancel reply

Ask me a question, free

If your site is private or in trial, just setup password and share url. See how to: https://beaverhero.com/squarespace-how-to/
Please check your email carefully. Recently I got a lot of questions with wrong emails.

If you haven't heard from me within 24 hours please check your junk/spam folder