Twitter引导轮播左右控制

时间:2015-07-26 17:11:46

标签: html twitter-bootstrap

目前我的Bootstrap轮播上的左右控件都不起作用,我试图找出原因。幻灯片不会改变。任何帮助将不胜感激。

html代码:

<div id="myCarousel" class="carousel slide" data-ride="carousel">
  <!-- Indicators -->
  <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>
    <li data-target="#myCarousel" data-slide-to="3"></li>
  </ol>

  <!-- Wrapper for slides -->
  <div class="carousel-inner" role="listbox">
    <div class="item active">
      <img src="images/anaesthesiaexams/cap1.png" alt="Chania">
    </div>
    <div class="item">
      <img src="images/anaesthesiaexams/cap2.png" alt="Chania">
    </div>
    <div class="item">
      <img src="images/anaesthesiaexams/cap3.png" alt="Flower">
    </div>
    <div class="item">
      <img src="images/anaesthesiaexams/cap4.png.jpg" alt="Flower">
    </div>
  </div>

  <!-- Left and right controls -->
  <a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
    <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
    <span class="sr-only">Previous</span>
  </a>
  <a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
    <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
    <span class="sr-only">Next</span>
  </a>
</div>

1 个答案:

答案 0 :(得分:1)

嘿,你有js和jquery链接?

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>