gpt4 book ai didi

html - 宏伟的弹出式画廊不弹出

转载 作者:行者123 更新时间:2023-11-28 16:36:35 26 4
gpt4 key购买 nike

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

    <!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

关于html - 宏伟的弹出式画廊不弹出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34431522/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com