Fancybox和bootstrap:模态图像缩放问题

时间:2018-03-05 14:03:28

标签: css fancybox bootstrap-4

当我将img放入fancybox链接时,打开的图像会缩放20次,当有简单的文字时,没有问题。我是否使用bootstrap以某种方式相关?是否有可能解决这个问题?

https://jsfiddle.net/16region/svse3c5x/



.col-sm-3 {
  height:200px;
  margin-bottom:30px;
}

.col-sm-3 img {
  width: 30px;
}

<!DOCTYPE html>
<html lang="en">
  <head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.2.5/jquery.fancybox.min.css" />
  </head>
  <body>
   <div class="container">
     <div class="row no-gutters">
       <div class="col-sm-3 bg-success">
         <a data-fancybox="gallery" href="https://www.w3schools.com/w3css/img_fjords.jpg">
                        <img src="https://cdn3.iconfinder.com/data/icons/gray-toolbar/512/find-512.png" alt="">
                    </a>
       </div>
       <div class="col-sm-3 bg-info"></div>
       <div class="col-sm-3 bg-success"></div>
       <div class="col-sm-3 bg-info"></div>
       <div class="col-sm-3 bg-success"></div>
       <div class="col-sm-3 bg-info"></div>
       <div class="col-sm-3 bg-success"></div>
       <div class="col-sm-3 bg-info"></div>
     </div>
   </div>

    <!-- jQuery first, then Tether, then Bootstrap JS. -->
    <script src="https://code.jquery.com/jquery-3.1.1.slim.min.js" integrity="sha384-A7FZj7v+d/sdmMqp/nOQwliLvUsJfDHW+k9Omg/a/EheAdgtzNs3hpfag6Ed950n" crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js" integrity="sha384-DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUYHKkDx6Qin1DkWx51bBrb" crossorigin="anonymous"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js" integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" crossorigin="anonymous"></script>
 <script src="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.2.5/jquery.fancybox.min.js"></script>

  </body>
</html>
&#13;
&#13;
&#13;

0 个答案:

没有答案