Jump to content

How to fix image overflow container in gallery stacked slide design

Go to solution Solved by sorca_marian,

Recommended Posts

Hi!
One of my clients uses multiple gallery-blocks on her blogpages in stacked-slide-design between multiple text-blocks. Cropping is off. Show Title and Description is on.
There is a problem of images overflowing the container and text-blocks underneath the slider.Β 
Is there a way to keep all the sliders and force the images into the container while keeping the image ratio?

I don't know what causes the problem, there is some custom code and code injection but de-activating scripts and code did not fix the issue. Not completely sure what i'm doing though :^|

Hope there is a fix,
thanks!

Edited by Mieke
Link to comment
  • Replies 20
  • Views 1.3k
  • Created
  • Last Reply

Top Posters In This Topic

I just fixed this issue recently.

It's probably from a Squarespace update.

Add this code to Custom CSS

 .sqs-gallery-block-stacked img[height] {
	height : auto;
}

Β 

πŸ‘¨β€πŸ”§πŸ‘¨β€πŸ’»Β Contact me for development and design work - Freelancer Software engineer, Architect, and Designer UI/UX

πŸ™‹β€β™‚οΈΒ Squarespace Custom Web Development & Design

πŸ“…Β Manage Tasks, Take Notes, and Upload Related Images

πŸ“ΉΒ Squarespace Tutorials for free - YouTubeπŸ“ΉΒ 

πŸ’―πŸš€ I have worked on over 200 Squarespace sites with custom code for over 9 years

πŸ™‹β€β™‚οΈΒ Let's connect on LinkedIn

Β 

Β 

Link to comment

Wow, that's quick :^) thank you!
I took some try and search time..

Your code didn't fix the problem in my case,Β clearing cache en refreshing browser helps (but did help before too) for the active slider, the ones that follow still give overflow..
(Added { ... !important}, no difference..)

So i tried a few sliders on my own site in one blog-page, with same/different settings, combined portret and landscape images in one slider, with/without Title/Description, with/without thumbnailsΒ - cleared cache with every change - but the same problem, with every time a random (bad) result.

Funny: No problem with only one slider on the page (with or without your code) :^/

Edited by Mieke
Link to comment

Can you share a link or a screenshot?

πŸ‘¨β€πŸ”§πŸ‘¨β€πŸ’»Β Contact me for development and design work - Freelancer Software engineer, Architect, and Designer UI/UX

πŸ™‹β€β™‚οΈΒ Squarespace Custom Web Development & Design

πŸ“…Β Manage Tasks, Take Notes, and Upload Related Images

πŸ“ΉΒ Squarespace Tutorials for free - YouTubeπŸ“ΉΒ 

πŸ’―πŸš€ I have worked on over 200 Squarespace sites with custom code for over 9 years

πŸ™‹β€β™‚οΈΒ Let's connect on LinkedIn

Β 

Β 

Link to comment

It is probably from a Squarespace update.

While it is getting fixed, try adding this code in Page Header Code Injection -> Footer

<script>
window.setTimeout(function(){
    Y.one(window).simulate("resize");
}, 1000);
</script>


Here is the place to add the code - at 1:54

Β 

πŸ‘¨β€πŸ”§πŸ‘¨β€πŸ’»Β Contact me for development and design work - Freelancer Software engineer, Architect, and Designer UI/UX

πŸ™‹β€β™‚οΈΒ Squarespace Custom Web Development & Design

πŸ“…Β Manage Tasks, Take Notes, and Upload Related Images

πŸ“ΉΒ Squarespace Tutorials for free - YouTubeπŸ“ΉΒ 

πŸ’―πŸš€ I have worked on over 200 Squarespace sites with custom code for over 9 years

πŸ™‹β€β™‚οΈΒ Let's connect on LinkedIn

Β 

Β 

Link to comment

Did it work?

πŸ‘¨β€πŸ”§πŸ‘¨β€πŸ’»Β Contact me for development and design work - Freelancer Software engineer, Architect, and Designer UI/UX

πŸ™‹β€β™‚οΈΒ Squarespace Custom Web Development & Design

πŸ“…Β Manage Tasks, Take Notes, and Upload Related Images

πŸ“ΉΒ Squarespace Tutorials for free - YouTubeπŸ“ΉΒ 

πŸ’―πŸš€ I have worked on over 200 Squarespace sites with custom code for over 9 years

πŸ™‹β€β™‚οΈΒ Let's connect on LinkedIn

Β 

Β 

Link to comment

Try with a higher delay

<script>
window.setTimeout(function(){
    Y.one(window).simulate("resize");
}, 3000);
</script>

Β 

πŸ‘¨β€πŸ”§πŸ‘¨β€πŸ’»Β Contact me for development and design work - Freelancer Software engineer, Architect, and Designer UI/UX

πŸ™‹β€β™‚οΈΒ Squarespace Custom Web Development & Design

πŸ“…Β Manage Tasks, Take Notes, and Upload Related Images

πŸ“ΉΒ Squarespace Tutorials for free - YouTubeπŸ“ΉΒ 

πŸ’―πŸš€ I have worked on over 200 Squarespace sites with custom code for over 9 years

πŸ™‹β€β™‚οΈΒ Let's connect on LinkedIn

Β 

Β 

Link to comment

No, it is JavaScript language πŸ™‚

3000 and 1000 represent a delay in milliseconds until the code runs.
It makes a window resize to adjust the styling. I noticed that when I resized my window, the captions were aligned normallyΒ 

πŸ‘¨β€πŸ”§πŸ‘¨β€πŸ’»Β Contact me for development and design work - Freelancer Software engineer, Architect, and Designer UI/UX

πŸ™‹β€β™‚οΈΒ Squarespace Custom Web Development & Design

πŸ“…Β Manage Tasks, Take Notes, and Upload Related Images

πŸ“ΉΒ Squarespace Tutorials for free - YouTubeπŸ“ΉΒ 

πŸ’―πŸš€ I have worked on over 200 Squarespace sites with custom code for over 9 years

πŸ™‹β€β™‚οΈΒ Let's connect on LinkedIn

Β 

Β 

Link to comment

I see it is working now.

That CSS code is for the stacked gallery. I thought you had the same issue as a previous client. That CSS is not necessary if you don't have a gallery-type stackedΒ 

Edited by sorca_marian

πŸ‘¨β€πŸ”§πŸ‘¨β€πŸ’»Β Contact me for development and design work - Freelancer Software engineer, Architect, and Designer UI/UX

πŸ™‹β€β™‚οΈΒ Squarespace Custom Web Development & Design

πŸ“…Β Manage Tasks, Take Notes, and Upload Related Images

πŸ“ΉΒ Squarespace Tutorials for free - YouTubeπŸ“ΉΒ 

πŸ’―πŸš€ I have worked on over 200 Squarespace sites with custom code for over 9 years

πŸ™‹β€β™‚οΈΒ Let's connect on LinkedIn

Β 

Β 

Link to comment

My client has very long blogposts with about 40+ sliders 😱, reading time about one hourΒ πŸ₯΅

But you are right: resizing works.Β 
So the page has to resize multiple times.Β 

Hope there will be an update soon to fix it then πŸ™‚

Thanks again!!

Link to comment
  • Solution

Yes, it's a hack to make it work.
As soon as it is fixed you can remove the code.

Don't forget to mark the solution here

πŸ‘¨β€πŸ”§πŸ‘¨β€πŸ’»Β Contact me for development and design work - Freelancer Software engineer, Architect, and Designer UI/UX

πŸ™‹β€β™‚οΈΒ Squarespace Custom Web Development & Design

πŸ“…Β Manage Tasks, Take Notes, and Upload Related Images

πŸ“ΉΒ Squarespace Tutorials for free - YouTubeπŸ“ΉΒ 

πŸ’―πŸš€ I have worked on over 200 Squarespace sites with custom code for over 9 years

πŸ™‹β€β™‚οΈΒ Let's connect on LinkedIn

Β 

Β 

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.