-1

弹出窗口不起作用 - 它是 iframe 类型,正在尝试加载 Google 地图。我已将代码配对到绝对最小值。使用 Firefox 中的 Web 开发人员工具栏,我已经确认链接的 js 代码正在加载,但单击链接只是导航到 Google 地图站点。

我究竟做错了什么?

<!DOCTYPE html>
<html lang="en" prefix="og: http://ogp.me/ns#">
<head>
<title>magnificPopup</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <link rel="stylesheet" href="js/magnific-popup.css" />
</head>
<body>
    <div style="margin:50px;">
    <a class="popup-gmaps" href="https://maps.google.com/maps?q=221B+Baker+Street,+London,+United+Kingdom&amp;hl=en&amp;t=v&amp;hnear=221B+Baker+St,+London+NW1+6XE,+United+Kingdom">Open Google Map</a>
    </div>
<script type="text/javascript">
    $(document).ready(function () {
        $('.popup-gmaps').magnificPopup({
            disableOn: 700,
            type: 'iframe',
            removalDelay: 160,
            preloader: false,
            fixedContentPos: false
           });
       });
    </script>
    <script src="js/Zeptov1.js" type="text/javascript"></script>
    <script src="js/jquery.magnific-popup.min.js" type="text/javascript"></script>
</body>
</html>
4

1 回答 1

0

我看不到任何 jQuery 核心包含;首先加载 jQuery,而不是插件和您的代码。

尝试将代码更改为:

<!DOCTYPE html>
<html lang="en" prefix="og: http://ogp.me/ns#">
<head>
    <title>magnificPopup</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <link rel="stylesheet" href="js/magnific-popup.css" />
    <script src="http://code.jquery.com/jquery-latest.min.js"></script>
    <script src="js/Zeptov1.js" type="text/javascript"></script>
    <script src="js/jquery.magnific-popup.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $('.popup-gmaps').magnificPopup({
                disableOn: 700,
                type: 'iframe',
                removalDelay: 160,
                preloader: false,
                fixedContentPos: false
             });
         });
    </script>
</head>
<body>
    <div style="margin:50px;">
    <a class="popup-gmaps" href="https://maps.google.com/maps?q=221B+Baker+Street,+London,+United+Kingdom&amp;hl=en&amp;t=v&amp;hnear=221B+Baker+St,+London+NW1+6XE,+United+Kingdom">Open Google Map</a>
    </div>
</body>
</html>
于 2013-09-13T18:29:07.367 回答