宏伟的弹出式画廊不弹出

magnific popup gallery not popping up

我正在尝试使用 magnific popup 在我的网页上创建一个画廊,但我无法让图像显示在弹出窗口中,它只显示在一个单独的选项卡中。如何让它显示在画廊视图中并启用循环浏览网页画廊中的所有图像?另外,如何改变正在显示的灯箱的大小和缩略图的大小。

    <!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <title></title>
        <meta name="description" content="">
        <meta name="author" content="">
        <meta name="viewport" content="width=device-width; initial-scale=1.0">

      <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
      <!-- Magnific Popup core CSS file -->
      <link rel="stylesheet" href="magnific-popup/magnific-popup.css">

      <!-- Magnific Popup core JS file -->
      <script src="magnific-popup/jquery.magnific-popup.js"></script>

      <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
      <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css">
      <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
      <link rel="stylesheet" href="css/style.css">

  <style type="text/css">

    .modal-dialog {}
.thumbnail {margin-bottom:6px; height: 280px;}

.carousel-control.left,.carousel-control.right{
  background-image:none;
  margin-top:10%;
  width:5%;
}

#open-popup {padding:20px}
.white-popup {
  position: relative;
  background: #FFF;
  padding: 40px;
  width: auto;
  max-width: 200px;
  margin: 20px auto;
  text-align: center;
}

  </style>

  <script type="text/javascript">

    $(document).ready(function() {
  $('.image-link').magnificPopup({type:'image'});

  $('.test-popup-link').magnificPopup({
  type: 'image'
  // other options
});

});




  </script>
    </head>

    <body>
                <div id="main" role="main">
            <br />
                    <br />
        <br />

<div class="parent-container">
  <a href="path-to-image-1.jpg">Open popup 1</a>
  <a href="path-to-image-2.jpg">Open popup 2</a>
  <a href="path-to-image-3.jpg">Open popup 3</a>
</div>


                    </body>
</html>

问题出在您的 HTML 标记上!!

<a href="path-to-image-1.jpg">Open popup 1</a>这行不通。

<a class="test-popup-link" href="path-to-image-1.jpg">Open popup 2</a>

但这行得通。

勾选Codepen