javascript - jQuery cycly 插件无法在线工作

标签 javascript jquery html

当我尝试这段代码时,一切都运行良好。
但当我把它上传到 github 页面后,就太可怕了。

这是代码:

<!DOCTYPE html>
<html>
<head>
    <title>CoffeeTech Slider</title>
    <link href="https://fonts.googleapis.com/css?family=Dancing+Script" rel="stylesheet">
    <link rel="stylesheet" href="css/style.css">
    <script
  src="https://code.jquery.com/jquery-3.1.1.js"
  integrity="sha256-16cdPddA6VdVInumRGo6IbivbERE8p7CQR3HzTBuELA="
  crossorigin="anonymous"></script>
    <script src="http://malsup.github.io/jquery.cycle.all.js"></script>
</head>
<body>
    <div id="container">
    <h1>CoffeeTech</h1>
        <div class="slider">
            <img src="img/slide1.jpg" width="640" height="426">
            <img src="img/slide2.jpg" width="640" height="426">
            <img src="img/slide3.jpg" width="640" height="426">
            <img src="img/slide4.jpg" width="640" height="426">
            <img src="img/slide5.jpg" width="640" height="426">
        </div>

        <ul id="nav">
            <li id="prev"><a href="#">Previous</a></li>
            <li id="next"><a href="#">Next</a></li>
        </ul>
    </div>

    <script>
    $(document).ready(function(){
        $('.slider').cycle({
            fx: 'turnDown',
            pause: 1,
            prev: '#prev',
            next: '#next'
        });
    });
    </script>
</body>
</html>

Github link
The page it's displaying horribly

最佳答案

@Xufox 是对的,我在 Firefox 的控制台中有一条消息: 混合内容在加载时被阻止 http://malsup.github.io/jquery.cycle.all.js

这似乎与您的页面使用 https 并且您从 http 链接加载内容这一事实有关 More about mixed content

关于javascript - jQuery cycly 插件无法在线工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46288198/

相关文章:

javascript - 我在使用 jQuery 切换侧边栏时遇到问题

Javascript Date.UTC() 返回前一天

html - 带有下拉列表的文本框作为组插件

html - 我怎样才能 "clear"flexbox 元素?

javascript - Bootstrap3 模型由 Slider 重叠

javascript - 设置隐藏字段的值不适用于 jQuery

jquery - 为什么在打印区域中省略了 css

javascript - 如何改进我的 "random words cloud"函数?

html - 了解发送用户凭据时 crossorigin = "use credentials"属性的值

javascript - 搜索过滤器嵌套数组在 Object.Assign 之后修改原始数组