我试过官方的jQuery Mobile弹出窗口,现在也尝试Magnific Popup插件和're都显示在我的网页上的弹出窗口的内容而不是隐藏它并稍后在模式中显示它。jQuery弹出内容显示在页面上,弹出窗口不显示
的index.php:
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="stylesheet" type="text/css" href="magnific.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script src="magnific.js"></script>
<script src="moment.js"></script>
<script src="livestamp.min.js"></script>
<script src="main.js"></script>
</head>
<body>
<div class="wrapper">
<!-- Like so: -->
<a href="#test-popup" class="open-popup-link">Show inline popup</a>
<!-- Or like so: -->
<a href="mobile-friendly-page.html" data-mfp-src="#test-popup" class="open-popup-link">Show inline popup</a>
<!-- Popup itself -->
<div id="test-popup" class="white-popup mfp-with-anim mfp-hide">You may put any HTML here. 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.</div>
main.js:
$(document).ready(function() {
$('.open-popup-link').magnificPopup({
type:'inline',
midClick: true // Allow opening popup on middle mouse click. Always set it to true if you don't provide alternative source in href.
});
});
出于某种奇怪的原因,弹出窗口没有显示出来,而是我看到它在index.php
内容。 jQuery-Mobile Popup的结果相同。我究竟做错了什么?
谢谢你的详细答案,我会在我有空闲时候检查它,并会告诉你是否有用。 – Ricardo