Refresh Theme Banner image behavior

Hello,

I am using the Refresh theme and I added a banner with “Zoom In on scroll” image behavior. The problem is on Desktop it looks great but on mobile the image is zoomed in without even scrolling.
When I set the image behavior to none it works fine on both mobile and desktop.
I really would like to use “Zoom in scroll” image behavior and I tried some of the CSS code recommended on the internet but nothing worked.

link: www.pestapart.com

Pass: gawhim

Check if you can turn it off for the mobile version. There is a problem with the mobile version also zooming in.

Hacky way - you have to replace object-cover from cover to contain value.

Hi @ch4rbelk

Because mobile screens are smaller than desktop screens, so images can be displayed only partially, not in full.

Thank you Lynth for your quick response.
I tried what you suggested but it applied to all my banners. The banner that I want to modify became zoomed out which is good but there are now blank spaces above and under it.
If I turn it off but setting the image behavior to none, It works fine.

Hi Dan,

When I put the image behavior as none, it works fine on desktop and mobile. So I don’t think it is related to mobile or desktop screens.

you have to specify the class so as not to affect all. Add maybe #Banner-template–15474553880710__image_banner_gmRjWx (it’s a unique ID, but I’m not sure it is dynamic).

Great, now it is only affecting the banner that I want.
But what about the blank spaces above and under the banner that I want to adjust? Is there a way so that the mobile banner cover the whole space? should I change the aspect ratio?

Thanks in advance

Go to the Online Store - Theme - three dots - and search the .css extension file, it could be custom.css / base.css or something like this.
Then paste this inside, on the bottom:

@media screen and (max-width: 640px) {
#Banner-template--15474553880710__image_banner_gmRjWx .media > img {
  object-fit: contain !important;
}
}

max-width is your maximum screen width where these styles should be added.

Thanks Lynth, I will check it out!

Sure, let me know if you still need help. If I help you with my advice, just remember to mark it as a solution :wink:

The image now is zoomed out in the Banner which is great but still shows blank space above and below the image.
I think the problem is with this function itself inside Shopify. Based on what I found online other people had the same problem and couldn’t fix it.
I will change the image behavior to none and keep it that way since it fits perfectly.

Thanks Anyway