如何在 FancyBox 上制作所有图像 1:1 纵横比?

问题描述

我对 fancybox v3 缩略图有疑问。 我想要 1:1 纵横比的所有缩略图图像。 在图库视图中一切正常。 我该如何解决这个问题? 我需要改变什么价值? 查看Photo了解更多信息

引导程序版本:5 PHP 版本:7.4 fancybox 版本:3

HTML 代码

<!DOCTYPE html>
<html lang="it">

<head>
  <title>Annuario | ProLab</title>
  <Meta charset="utf-8">
  <Meta http-equiv="X-UA-Compatible" content="IE=edge">
  <Meta name="viewport" content="width=device-width,initial-scale=1.0">

  <link rel="stylesheet" href="../../../../css_bootstrap/bootstrap.min.css">
  <link rel="stylesheet" href="../../../../css/index_style.css">

  <!-- fancybox CSS library -->
  <link rel="stylesheet" href="/PHP/fancybox/jquery.fancybox.css">

  <!-- Stylesheet file -->
  <link rel="stylesheet" href="../../../stylegalleria.css">

  <!-- jQuery library -->
  <script src="../../../js/jquery.min.js"></script>

  <!-- fancybox JS library -->
  <script src="../../../fancybox/jquery.fancybox.js"></script>




  <!-- Initialize fancybox -->
  <script>
    $("[data-fancybox]").fancybox();
  </script>
</head>

<body>
  
  
    <div class="containerGriglia"  id="screenshot">

      <div class="rowGriglia">
        
        <div class="galleria" id="screenshot">
          <?PHP

          require '../connessione_liceo_cavalieri.PHP';

          $query = $db->query("SELECT * FROM 2ASU WHERE status = 1 ");

          if ($query->num_rows > 0) {
            while ($row = $query->fetch_assoc()) {
              $imageThumbURL = 'img/' . $row["file_name"];
              $imageURL = 'img/' . $row["file_name"];
              $nome = '' . $row["nome"];
              $cognome = '' . $row["cognome"];
          ?>

              <a href="<?PHP echo $imageURL; ?>" data-fancybox="gallery" data-caption="<?PHP echo $row["title"]; ?>">
                <img src="<?PHP echo $imageThumbURL; ?>" alt="">
                <?PHP echo  $nome; ?>
                <?PHP echo  $cognome; ?>
              </a>

          <?PHP }
          } ?>
        </div>
      </div>
    </div>
  </div>
  </div>
  <script src="../../../../js_bootstrap/bootstrap.bundle.min.js"></script>

</body>

</html>

CSS 代码

.containerGriglia{
    padding: -20px;
    float: left;
    width: 1000px;
    height: 1000px;


}
.galleria a{
    text-decoration: none;
    padding: 5px;
    float: left;
    width: 20%;

}
.galleria img {
    width:100%;
    height: auto;
    border-radius: 5px;
    cursor: pointer;
    transition: .3s;

}

.rowGriglia{
    margin-right: 30px;
    margin-left: 30px;
}

*{
    margin:0;
    padding:0;
}

感谢大家的回复

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)