我試過官方的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