简体   繁体   English

如何更改此灯箱#lightbox2 的默认图像大小?

[英]How can I change the default image size of this lightbox #lightbox2?

I'm trying to build a gallery website an i'm using the lightbox2 of this guy: https://lokeshdhakar.com/projects/lightbox2/我正在尝试建立一个画廊网站,我正在使用这个人的 lightbox2: https://lokeshdhakar.com/projects/lightbox2/

Can somebody tell me, where I can change the default image size?有人可以告诉我,我可以在哪里更改默认图像大小? I want the picture in full screen size.我想要全屏尺寸的图片。 The default image size is to small.默认图像尺寸太小。

JS: I can't post the whole JS Code because it's to big and i don't know which part it is. JS:我不能发布整个 JS 代码,因为它太大了,我不知道它是哪一部分。 But you can find the JS code here: https://github.com/lokesh/lightbox2/blob/dev/dist/js/lightbox-plus-jquery.min.js但是你可以在这里找到 JS 代码: https://github.com/lokesh/lightbox2/blob/dev/dist/js/lightbox-plus-jquery.min.js

CSS: 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
 }

What if you change the options to fitImagesInViewport:true options are here如果您将选项更改为fitImagesInViewport:true选项会在这里

Or change the css to have responsive img based on the size of the container?还是根据容器的大小更改 css 以具有响应式 img?

img{
width: 100%;
height: auto;
}
.image-container{
 width: 100vw;
 height: 100%;
}

html html

 <div class="image-container">
    <img src="https://picsum.photos/id/1025/200/300" />
 </div>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM