Js Carousel在添加到网站时无法正常工作

时间:2018-06-01 14:02:03

标签: javascript jquery carousel

帮助我找到了我要添加到我的网站的徽标轮播的代码,但是当我将代码写入我的网站时,轮播根本不起作用。所有文件都已放入正确的位置。

我认为问题在于我将HTML文件的链接放在HTML文件中的哪个位置?

    <div class="container">
      <section class="customer-logos slider">
        <div class="slide"><img src="img/Mascot_logo.jpg"></div>
        <div class="slide"><img src="img/Mascot_logo.jpg"></div>
        <div class="slide"><img src="img/Mascot_logo.jpg"></div>
        <div class="slide"><img src="img/Mascot_logo.jpg"></div>
        <div class="slide"><img src="img/Mascot_logo.jpg"></div>
        <div class="slide"><img src="img/Mascot_logo.jpg"></div>
        <div class="slide"><img src="img/Mascot_logo.jpg"></div>
        <div class="slide"><img src="img/Mascot_logo.jpg"></div>
      </section>
    </div>





      <!-- Optional JavaScript -->
      <script src="https://code.jquery.com/jquery-2.2.0.min.js" type="text/javascript"></script>
      <script src="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.6.0/slick.js"></script>

      <!-- jQuery first, then Popper.js, then Bootstrap JS -->

      <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
      <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
      <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.4.5/js/mdb.min.js"></script>
      <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>

  </body>

</html>

1 个答案:

答案 0 :(得分:2)

问题很可能不是你放置链接的地方,而是你没有调用任何函数来启动轮播。我看到您使用了slick.js - 您必须调用类似$('.slider').slick();的内容来启动它。 Slick将提供所有这些的文档。