Bootstrap Carousel仅加载一张图片

时间:2015-12-30 21:47:34

标签: jquery html css twitter-bootstrap carousel

我开始我的第一个项目并尝试合并旋转木马但由于某种原因旋转木马不会加载其他图片,当我尝试点击底部的圆圈来查看其他图片时它只保留在第一个。我按照发球的指示,看了一会儿,但似乎无法让它发挥作用

<!DOCTYPE html>
<html lang="en">
  <head>
     <title>Agapé Dance Company ∞</title>
     <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/style.css" rel="stylesheet">
  </head>

  <body>


<!--Carousel section -->
            <div id="#myCarousel" class="carousel">
                <ol class="carousel-indicators">
                    <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
                    <li data-target="#myCarousel" data-slide-to="1"></li>
                    <li data-target="#myCarousel" data-slide-to="2"></li>
                </ol>
                <div class="carousel-inner">
                    <div class="item active">
                        <img src="images/1.jpg" alt="agape performing" class="img-responsive">
                    </div>  
                    <div class="item">
                        <img src="images/2.jpg" alt="agape performing" class="img-responsive">
                    </div>  
                    <div class="item">
                        <img src="images/3.jpg" alt="agape performing" class="img-responsive">
                    </div>  
                </div>  
            </div>          

    <script src="js/jquery.min.js"></script>
    <script src="js/bootstrap.min.js"></script>

  </body>
</html>

1 个答案:

答案 0 :(得分:0)

你忘记了什么。我添加了一个属性data-ride =&#34; carousel&#34;和类滑到

<div id="#myCarousel" class="carousel slide" data-ride="carousel">

和滑块开始工作。