我用一个链接创建了一些代码。当我单击链接 #1 时,会弹出一个窗口,其中包含一些文本/html。您可以在此处查看示例:http: //johnnylai.me/popup
当我单击带有不同文本/html 的链接 #2 时,如何确保获得另一个弹出窗口?等等链接#3和#4?
HTML & jQuery code:
<code>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Popup Examples</title>
<link href="http://www.jqueryscript.net/css/jquerysctipttop.css" rel="stylesheet">
<link href="dist/magnific-popup.css" rel="stylesheet" type="text/css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="dist/jquery.magnific-popup.js"></script>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<a class="popup-with-zoom-anim" href="#small-dialog">#1 - fade-zoom animation</a><br>
<br>
<a class="popup-with-zoom-anim1" href="#small-dialog">#2 - fade-zoom animation</a><br>
<div id="small-dialog" class="mfp-hide">
<h1>Dialog example1</h1>
<p>This is dummy copy. It is not meant to be read. It has been placed here solely to demonstrate the look and feel of finished, typeset text. Only for show. He who searches for meaning here will be sorely disappointed.</p>
</div>
<div id="small-dialog" class="mfp-hide">
<h1>Dialog example2</h1>
<p>This is dummy copy. It is not meant to be read. It has been placed here solely to demonstrate the look and feel of finished, typeset text. Only for show. He who searches for meaning here will be sorely disappointed.</p>
</div>
<script>
$(document).ready(function() {
$('.popup-with-zoom-anim').magnificPopup({
type: 'inline',
fixedContentPos: false,
fixedBgPos: true,
overflowY: 'auto',
closeBtnInside: true,
preloader: false,
midClick: true,
removalDelay: 300,
mainClass: 'my-mfp-zoom-in'
});
});
</script>
</body>
</html>
</code>