简体   繁体   中英

.fancybox is not being recognised as a function

I've gone through the other solutions to this question and none seem to work. I still think there is a problem with the scripts. Here is my :

<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>

And body:

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

it have some type mistake

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

please correct it as,

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

try once again it may help you

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM