我的轮播无法正常工作是什么问题?

时间:2020-08-12 06:48:47

标签: bootstrap-4 carousel

<html lang="en">
 <head>
   <link rel="stylesheet" href="bootstrap-4.5.0-dist/css/bootstrap.css">
   <link rel="stylesheet" href="bootstrap-4.5.0-dist/css/bootstrap-grid.css">   
   <link rel="stylesheet" href="font-awesome-4.7.0/css/font-awesome.css">
   <link rel="stylesheet" href="style.css">
   <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
   <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
   <script src="bootstrap-4.5.0-dist/js/bootstrap.js"></script>
   <meta charset="utf-8">
   <title>Reveal</title>
 </head>
<body>
<div id="myslideshow" class="carousel slide carousel-fade" data-ride="carousel">
    <div class="carousel-inner">
        <div class="carousel-item mr-0 active">
            <img src="Reveal/assets/img/intro-carousel/1.jpg" alt="pic" class="d-block w-100">
        </div>
        <div class="carousel-item mr-0">
            <img src="Reveal/assets/img/intro-carousel/2.jpg" alt="" class="d-block w-100">
        </div>
        <div class="carousel-item mr-0">
            <img src="Reveal/assets/img/intro-carousel/3.jpg" alt="c" class="d-block w-100">
        </div>
        <div class="carousel-item mr-0">
            <img src="Reveal/assets/img/intro-carousel/4.jpg" alt="c" class="d-block w-100">
        </div>
        <div class="carousel-item mr-0">
            <img src="Reveal/assets/img/intro-carousel/5.jpg" alt="c" class="d-block w-100">
        </div>
</div>
    </div>
</body>
</html>

我的轮播无法正常运行,我也不知道出了什么问题,即使我从主引导站点复制了代码,但再次无法正常工作。我的照片将通过浏览器呈现,但不会滑动。有人可以帮助我吗?

1 个答案:

答案 0 :(得分:0)

问题出在BootstrapCDN(内容交付网络)上。 我使用了here

的BootstrapCDN

<html lang="en">
 <head>
   <meta charset="utf-8">
   <title>Reveal</title>
   <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
   <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script>
 </head>
<body>
<div id="myslideshow" class="carousel slide carousel-fade" data-ride="carousel">
    <div class="carousel-inner">
        <div class="carousel-item mr-0 active">
            <img src="Reveal/assets/img/intro-carousel/1.jpg" alt="pic" class="d-block w-100">
        </div>
        <div class="carousel-item mr-0">
            <img src="Reveal/assets/img/intro-carousel/2.jpg" alt="" class="d-block w-100">
        </div>
        <div class="carousel-item mr-0">
            <img src="Reveal/assets/img/intro-carousel/3.jpg" alt="c" class="d-block w-100">
        </div>
        <div class="carousel-item mr-0">
            <img src="Reveal/assets/img/intro-carousel/4.jpg" alt="c" class="d-block w-100">
        </div>
        <div class="carousel-item mr-0">
            <img src="Reveal/assets/img/intro-carousel/5.jpg" alt="c" class="d-block w-100">
        </div>
</div>
    </div>
</body>
</html>