简体   繁体   English

Fancybox打开时不适合图像

[英]Fancybox doesn't fit image when open

When I trying to open image it doesn't fit to scale. 当我尝试打开图像时,它不适合缩放。 I even tried to use example, presented on the official site. 我什至尝试使用官方网站上提供的示例。 It doesnt work on a local pages, but works on jsfiddle and similar sites (with the same html/css). 它在本地页面上不起作用,但是在jsfiddle和类似站点(具有相同的html / css)上起作用。

Here's an example of code and some animation of how it works on a local server (ZF3 skeleton app used). 这是一个代码示例 ,以及一些代码示例及其在本地服务器上的工作方式(使用ZF3骨架应用)。 There's just bootstrap 4 (it works the same w/o bootstrap) style for image grid like on official site: 像官方网站上一样,图像网格只有bootstrap 4(它与不带bootstrap相同)的样式:

.image_grid {
  padding-left: 15px;
  padding-right: 15px;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  max-width: 100%;
  margin-right: auto;
  margin-left: auto;
  -webkit-flex-wrap: wrap;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  a {
    padding: 5px;
    -webkit-box-flex: 1;
    -webkit-flex: 1 0 33.33%;
    -ms-flex: 1 0 33.33%;
    flex: 1 0 33.33%;
    img {
      width: 100%;
      max-height: auto;
    }
  }
}

在此处输入图片说明

将jQuery升级到最新版本,至少v3.2.0

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

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