[英]How can I change the default image size of this lightbox #lightbox2?
我正在尝试建立一个画廊网站,我正在使用这个人的 lightbox2: https://lokeshdhakar.com/projects/lightbox2/
有人可以告诉我,我可以在哪里更改默认图像大小? 我想要全屏尺寸的图片。 默认图像尺寸太小。
JS:我不能发布整个 JS 代码,因为它太大了,我不知道它是哪一部分。 但是你可以在这里找到 JS 代码: https://github.com/lokesh/lightbox2/blob/dev/dist/js/lightbox-plus-jquery.min.js
CSS:
.lb-loader,
.lightbox {
text-align: center;
line-height: 0;
position: absolute;
left: 0
}
body.lb-disable-scrolling {
overflow: hidden
}
.lightboxOverlay {
position: absolute;
top: 0;
left: 0;
z-index: 9999;
background-color: #000;
filter: alpha(Opacity=80);
opacity: .8;
display: none
}
.lightbox {
width: 100%;
z-index: 10000;
font-weight: 400;
outline: 0
}
.lightbox .lb-image {
display: block;
height: auto;
max-width: inherit;
max-height: none;
border: 4px solid #fff
}
.lightbox a img {
border: none
}
.lb-outerContainer {
position: relative;
width: 250px;
height: 250px;
margin: 0 auto;
border-radius: 4px;
background-color: #fff
}
.lb-outerContainer:after {
content: "";
display: table;
clear: both
}
.lb-loader {
top: 43%;
height: 25%;
width: 100%
}
.lb-dataContainer {
margin: 0 auto;
padding-top: 5px;
width: 100%;
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px
}
.lb-dataContainer:after {
content: "";
display: table;
clear: both
}
.lb-data {
padding: 0 4px;
color: #ccc
}
.lb-data .lb-details {
width: 85%;
float: left;
text-align: left;
line-height: 1.1em
}
.lb-data .lb-caption {
font-size: 13px;
font-weight: 700;
line-height: 1em
}
如果您将选项更改为fitImagesInViewport:true
选项会在这里
还是根据容器的大小更改 css 以具有响应式 img?
img{
width: 100%;
height: auto;
}
.image-container{
width: 100vw;
height: 100%;
}
html
<div class="image-container">
<img src="https://picsum.photos/id/1025/200/300" />
</div>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.