Flotzi Posted November 28, 2023 Posted November 28, 2023 Hi, I've changed the displayed image ratio of my shop's gallery slide image using the following CSS code: /* product images */ img.pdp-gallery-slides-image { object-fit: contain !important; } When images have different ratios, I can see the 'previous' images behind/below the currently displayed image as seen in the image attached. Is there a way to prevent this from happening? OR: Would it be possible to automatically adjust the wrapper's/container's height to the height of the current slide image, no matter the ratio? password for site access: hello@yumi72 Thanks in advance!
Web_Solutions Posted November 28, 2023 Posted November 28, 2023 1 hour ago, Flotzi said: Hi, I've changed the displayed image ratio of my shop's gallery slide image using the following CSS code: /* product images */ img.pdp-gallery-slides-image { object-fit: contain !important; } When images have different ratios, I can see the 'previous' images behind/below the currently displayed image as seen in the image attached. Is there a way to prevent this from happening? OR: Would it be possible to automatically adjust the wrapper's/container's height to the height of the current slide image, no matter the ratio? password for site access: hello@yumi72 Thanks in advance! Can you share your website URL? Flotzi 1 If my comments are useful, please like and mark my solution as answer. It will encourage me. Thanks MD Rofik Website Designer and Digital Marketer ☕Am I helpful? Want to offer me a coffee? ✉ Send me a message if needed any help. I'll try to reply as soon as possible.
Flotzi Posted November 28, 2023 Author Posted November 28, 2023 of course: https://www.yumiweaves.com/shop/p/dolores password for site access: hello@yumi72
Web_Solutions Posted November 29, 2023 Posted November 29, 2023 5 hours ago, Flotzi said: of course: https://www.yumiweaves.com/shop/p/dolores password for site access: hello@yumi72 I can't see the gallery slide If my comments are useful, please like and mark my solution as answer. It will encourage me. Thanks MD Rofik Website Designer and Digital Marketer ☕Am I helpful? Want to offer me a coffee? ✉ Send me a message if needed any help. I'll try to reply as soon as possible.
Flotzi Posted November 29, 2023 Author Posted November 29, 2023 The format is set to "wrap". So the slide only appears in mobile view or if you make your browser window really narrow.
Solution Web_Solutions Posted November 29, 2023 Solution Posted November 29, 2023 8 hours ago, Flotzi said: The format is set to "wrap". So the slide only appears in mobile view or if you make your browser window really narrow. Add these code on Custom CSS panel in Website > Utilities > Website Tools > Custom CSS. @media screen and (max-width: 767px) { .view-item .pdp-gallery .pdp-gallery-slides img{ object-position: center !important; object-fit: contain !important; visibility: hidden; } .view-item .pdp-gallery .pdp-gallery-slides.selected img{ visibility: visible !important; } } Kobir 1 If my comments are useful, please like and mark my solution as answer. It will encourage me. Thanks MD Rofik Website Designer and Digital Marketer ☕Am I helpful? Want to offer me a coffee? ✉ Send me a message if needed any help. I'll try to reply as soon as possible.
Flotzi Posted November 29, 2023 Author Posted November 29, 2023 this is working perfectly! thank you so much! 💥 alternatively, would it be possible to keep the "object-fill" at "cover" and increase the height of the "container'/gallery? at the moment the gallery's resolution is 1:1. Is there a way to change that, maybe to 3:2 ?
Web_Solutions Posted November 30, 2023 Posted November 30, 2023 6 hours ago, Flotzi said: this is working perfectly! thank you so much! 💥 alternatively, would it be possible to keep the "object-fill" at "cover" and increase the height of the "container'/gallery? at the moment the gallery's resolution is 1:1. Is there a way to change that, maybe to 3:2 ? Replace the pervious code with the code bellow. @media screen and (max-width: 767px) { .pdp-layout .pdp-gallery-images::before { padding-bottom: 130% !important; } .view-item .pdp-gallery .pdp-gallery-slides img { object-position:top !important; object-fit: contain !important; visibility: hidden } .view-item .pdp-gallery .pdp-gallery-slides.selected img { visibility: visible !important } } Kobir 1 If my comments are useful, please like and mark my solution as answer. It will encourage me. Thanks MD Rofik Website Designer and Digital Marketer ☕Am I helpful? Want to offer me a coffee? ✉ Send me a message if needed any help. I'll try to reply as soon as possible.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment