货物集体-雨刷器/“缩放”功能

问题描述 投票:0回答:1

我正在尝试自定义Cargo Collective中的灯箱/缩放功能,相信它使用了Photoswiper。截至目前,它已填满整个屏幕,并且希望能够控制其大小,使其不覆盖顶部和底部的导航栏。我可以在PSWP中添加一些填充或阻止吗? PSWP没有显示在常规CSS编辑器中。因此,似乎我需要添加一些自己的代码。目的是修剪顶部和底部,并在缩放时控制图像的大小。先感谢您。

css photoswipe cargo
1个回答
0
投票

我遇到了同样的问题,试图在我的货运集体网站中调整PhotoSwipe图像的大小。我将以下内容添加到自定义CSS中,并且效果很好:

.pswp img { 
object-fit: contain !important;
max-height: 400px !important;
max-width: auto !important;
margin-top: 100px;
margin-bottom: 100px;
 }

我还使用以下样式设置了背景样式。如果要在PhotoSwipe背景中添加间隙,也可以在此处顶部和底部添加边距。

.pswp__bg {
    background-color: #fff !important;
}
.Pswp_bg image-zoom-background {
    background-color: #fff !important;
}

干杯!

© www.soinside.com 2019 - 2024. All rights reserved.