JQuery Slick旋转木制不加载,CDN加载误差



JS和jQuery的新手,并且有一个问题使带有bootstrap jumbotron加载的问题。有4个背景图像具有.carousel内部的以下DIV,但它们仅按顺序加载,我在Chrome Inspect中遇到错误,声称Slick CDN是错误的,即使通过它直接从网站上复制。如果您有任何建议,请让我知道!

<!DOCTYPE html>
<html>
    <head>
        <link rel="stylesheet" href="./resource/reset.css">
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" 
        integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
        <link rel="stylesheet" type="text/css" href="//cdn.jsdelivr.net/jquery.slick/1.6.0/slick.css"/>
        <link rel="stylesheet" type="text/css" href="./resource/style.css">
        <link href="https://fonts.googleapis.com/css?family=Monoton|Open+Sans:400,600,700" rel="stylesheet">
        <link rel="icon" type="image/gif" href="./resource/favicon.png">
        <title>Jumpstart</title>
    </head>
<body>
    <!--Navigation Menu-->
    <nav class="navbar navbar-default navbar-fixed-top">
        <div class="container">
            <ul class="nav navbar-nav">
                <li class="active"><a href="#">Explore</a></li>
                <li><a href="#">Start a Project</a></li>
                <li><a href="#">About Us</a></li>
            </ul>
        <img class="navbar-brand navbar-right collapse 
        navbar-collapse visible-lg visible-md" src="./resource/images/logo.png" alt="Brand">
        </div>
    </nav>
    <!--Website Header with Scrolling Images-->
    <div class="carousel">
        <div class="jumbotron background jumbotron-bike">
            <div class="container-fluid">
                <h1>Get Going.</h1>
                <p>Jumpstart your startup with some crowdsourced seed money, or support one of our 300,000,000+ creators and get rewards.</p>
            </div>
        </div>
        <div class="jumbotron  background jumbotron-beer">
            <div class="container-fluid">
                <h1>GET THINKING.</h1>
                <p>Meet like-minded individuals who will help fuel your creative juices.</p>
            </div>
        </div>
        <div class="jumbotron background jumbotron-flowers">
            <div class="container-fluid">
                <h1>GET CREATING.</h1>
                <p>Stop overthinking projects and begin putting them out into the world.</p>
            </div>
        </div>
        <div class="jumbotron background jumbotron-duffel">
            <div class="container-fluid">
                <h1>GET STARTED.</h1>
                <p>What are you waiting for? Today's the day for your next big idea.</p>
            </div>
        </div>
    </div>
    <div class="relative-wrapper">
                <a href="#" class="btn btn-primary btn-lg">Jump In</a>
    </div>
    <!--Featured Project-->
    <div class="container featured-project">
       <div class="row">
            <h2 class="col-xs-12">Featured Project</h2>
        </div>
       <div class="row">
            <div class="col-xs-12 col-md-6">
                <div class="image-container">
                    <a href="#">
                        <img src="./resource/images/featured-project.png" alt="Featured Project" class="thumbnail">
                    </a>
                </div>
            </div>
            <div class="col-xs-6 col-md-3">
                <h3>Defrost: A Documentary</h3>
                <p>by Leo De Firenze</p>
                <p>"DeFrost is a documentary about growing up in a little red house in a cold, harsh valley. 
                This is a story about my mother's childhood. This film attempts to capture vignettes of her upbringing — her family, 
                friends, pets, and eventual depature from a freezing valley in Northern Italy — through beautiful cinematography and narration."
                </p>
            </div>
            <div class="col-xs-6 col-md-3 ">
                <h3>Product Categories</h3>
                <ul>
                    <li>Art</li>
                    <li>Books</li>
                    <li>Crystals</li>
                    <li>Design</li>
                    <li>Doodles</li>
                    <li>Deedlybobs</li>
                    <li>Farming</li>
                    <li>Gadgets</li>
                    <li>Hoverboards</li>
                    <li>Jams, Jellies, Etc.</li>
                    <li>Magazines</li>
                    <li>Plants</li>
                    <li>Snakes &amp; Snake Equipment</li>
                    <li>Tables</li>
                    <li>Ventriliquist Figures</li>
                    <li>Yoyos</li>
                </ul>
            </div>
        </div>
    </div>
<!--Projects List-->
    <div class="container">
       <div class="row">
            <h2 class="col-xs-12">Projects</h2>
        </div>
        <div class="row">
            <div class="col-xs-12 col-sm-4 project">
                <div class="image-container">
                    <a href="#">
                        <img src="./resource/images/project1.png" alt="Proj1" class="thumbnail">
                    </a>
                </div>
                <h3>The Right Tights</h3>
                <p>by Riley Mae</p>
                <p>These tights are 50 denier, beautifully constructed, 
                    hand-dyed, and guaranteed to last (no more ladders!). Made with high quality, 
                    completely toxic-free materials. Custom colors available to all backers.
                </p>
            </div>
            <div class="col-xs-12 col-sm-4 project">
                <div class="image-container">
                    <a href="#">
                        <img src="./resource/images/project2.png" alt="Proj2" class="thumbnail">
                    </a>
                </div>
                <h3>Peppermint Smart Home</h3>
                <p>by Brian McDonald</p>
                <p>Instantly upgrade your home with technology that keeps your family and home safe. 
                    We've made Peppermint easy to use. Just talk to your phone and Peppermint will help you every step of the way.
                </p>
            </div>
            <div class="col-xs-12 col-sm-4 project">
                <div class="image-container">
                    <a href="#">
                        <img src="./resource/images/project3.png" alt="Proj3" class="thumbnail">
                    </a>
                </div>
                <h3>American Streetlife</h3>
                <p>by Patrick Wallace</p>
                <p>I've been traveling around the United States for the past two years. I've slept on hundreds of couches, 
                    more than a few benches, and captured my experiences in this 120 page photo album.
                </p>
            </div>
        </div>
    </div>
<!--Having Trouble Section-->
    <div class="container-fluid help">
        <strong>Having Trouble thinking of an idea?</strong>
        <p>Inventors’ block strikes at the worst times. But that’s 
            all changed with Jumpstart’s Good Idea Generator Lite (GIGLi).</p>
        <a href="#" class="btn btn-primary">Learn More</a>
    </div>
    <script src="https://code.jquery.com/jquery-3.1.1.min.js"
  integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8="crossorigin="anonymous"></script>
    <script type="text/javascript" src="//cdn.jsdelivr.net/jquery.slick/1.6.0/slick.min.js"></script>
    <script type="text/javascript" src="./resource/main.js"></script>
</body>
</html>'

这是jQuery代码:`$(document(.ready(function(({

 $('.carousel').slick({
        autoplay: true,
        autoplaySpeed: 4000,
        arrows: false,
        fade: true,
        pauseOnFocus: false,
        pauseOnHover: false,
        // slidesToShow: 1,
        slidesToScroll: 4
    });
    var scrol = 0;

});`

也在git存储库中列出了它在这里看到它的现场:https://github.com/solaini/jumpstart

您的代码看起来不错。清除您的缓存&amp;cookie,然后尝试再次加载页面。如果您仍然有问题,请尝试替换:

  • //cdn.jsdelivr.net/jquery.slick/1.6.0/slick.min.js with。/resource/slick.min.js
  • //cdn.jsdelivr.net/jquery.slick/1.6.0/slick.css with ./resource/slick.css

您的代码在我的浏览器上效果很好:请参阅此。

最新更新