Jump to content

Smooth hover transition on Gallery

Recommended Posts

Hello everyone,

Please lend me your help.

Upon hover, my gallery images zooms in and out, the zoom in transition is smooth but the zoom out effect is rather sudden so the end result looks jumpy. Here is the code I used:

.gallery-grid-item
img:hover{ 
transform:Scale(1.1);
transition-duration: 1s;
}

.gallery-grid-item 
{overflow:hidden!important }

Please someone tell me what I did wrong in my code.

Here is the link to my gallery:
https://www.ptphotography.com/stmoritz-badrutts-palace-hotel-switzerland

For reference, we want to achieve the same smooth transition like this product page:
https://www.ptphotography.com/destination-trial

I used the same code for the product and gallery page but I don't know why they have different effect. Please help 🙏

Thank you in advance,
Kind regards,
K

Link to comment
  • Replies 2
  • Views 906
  • Created
  • Last Reply
4 hours ago, Ptphotography said:

Hello everyone,

Please lend me your help.

Upon hover, my gallery images zooms in and out, the zoom in transition is smooth but the zoom out effect is rather sudden so the end result looks jumpy. Here is the code I used:

.gallery-grid-item
img:hover{ 
transform:Scale(1.1);
transition-duration: 1s;
}

.gallery-grid-item 
{overflow:hidden!important }

Please someone tell me what I did wrong in my code.

Here is the link to my gallery:
https://www.ptphotography.com/stmoritz-badrutts-palace-hotel-switzerland

For reference, we want to achieve the same smooth transition like this product page:
https://www.ptphotography.com/destination-trial

I used the same code for the product and gallery page but I don't know why they have different effect. Please help 🙏

Thank you in advance,
Kind regards,
K

Move the transition property like so

.gallery-grid-item:hover img { 
		transform:Scale(1.1);
}
.gallery-grid-item img {
  		transition-duration: 1s;
}
.gallery-grid-item {
  	overflow: hidden!important;
}

 

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.