.fancybox 未被识别为一个功能

.fancybox is not being recognised as a function

本文关键字:一个 功能 识别 fancybox      更新时间:2023-09-26

我已经浏览了这个问题的其他解决方案,但似乎没有一个有效。我仍然认为脚本有问题。这是我的:

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1, minimal-ui" />
    <!-- JQuery -->
    <script src="js/jquery-1.11.3.js"></script>
    <!-- BS -->
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
    <link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />
    <!-- Fancybox -->
    <script type="text/javascript" src="fancybox/jquery.easing-1.3.pack.js"></script>
    <script type="text/javascript" src="fancybox/jquery.mousewheel-3.0.4.pack.js"></script>
    <script type="text/javascript" src-"fancybox/jquery.fancybox-1.3.4.pack.js"></script>
    <link rel="stylesheet" type="text/css" href="fancybox/jquery.fancybox-1.3.4.css">
    <!-- Custom CSS -->
    <link rel="stylesheet" href="style.css">
    <script>
        $(document).ready(function() {      
            if(location.hash) {
                $(location.hash).click();
            }
            $(".iframe").fancybox();
        });
    </script>
</head>

和身体:

<a class="iframe" href="https://player.vimeo.com/video/151002965">
    <img src="https://vimeo.com/151002965">
</a>

它有一些类型错误

<script type="text/javascript" src-"fancybox/jquery.fancybox-1.3.4.pack.js"></script>

请更正为,

<script type="text/javascript" src="fancybox/jquery.fancybox-1.3.4.pack.js"></script>

再试一次可能会对您有所帮助