html - 为什么轮播下一个按钮和圆形按钮不起作用

标签 html css twitter-bootstrap

这是我从 http://bootstrapbay.com/blog/bootstrap-3-carousel-tutorial/ 获得的轮播教程代码.轮播下一个按钮和轮播虚线按钮不起作用。我不知道会发生什么。请帮我解决这个问题。我把图像和红色按钮确定不起作用的按钮。

<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
      <!-- Indicators -->
      <ol class="carousel-indicators">
        <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
        <li data-target="#carousel-example-generic" data-slide-to="1"></li>
        <li data-target="#carousel-example-generic" data-slide-to="2"></li>
      </ol>

      <!-- Wrapper for slides -->
      <div class="carousel-inner">
        <div class="item active">
          <img src="http://placehold.it/1200x315" alt="...">
          <div class="carousel-caption">
              <h3>Caption Text</h3>
          </div>
        </div>
        <div class="item">
          <img src="http://placehold.it/1200x315" alt="...">
          <div class="carousel-caption">
              <h3>Caption Text</h3>
          </div>
        </div>
        <div class="item">
          <img src="http://placehold.it/1200x315" alt="...">
          <div class="carousel-caption">
              <h3>Caption Text</h3>
          </div>
        </div>
      </div>

      <!-- Controls -->
      <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
        <span class="glyphicon glyphicon-chevron-left"></span>
      </a>
      <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
        <span class="glyphicon glyphicon-chevron-right"></span>
      </a>
    </div> <!-- Carousel -->

Carousel ScreenShot

最佳答案

作为 tutorial you linked in the question 的第 2 步说,你必须添加以下标签来添加 jquery(顺序很重要):

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>

关于html - 为什么轮播下一个按钮和圆形按钮不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35889023/

相关文章:

java - 为 Spring 表单标签元素设置类和其他属性

javascript - 检测在文本中右键单击了哪个词

javascript - 基于javascript循环显示或隐藏字段

javascript - 元素之间的空白,来源不明

javascript - 如何在我的代码中使用 AJAX 和 JSON

html - IE11 在页面加载时闪烁,但在开发人员模式下不闪烁

html - Bootstrap - 屏幕上的错误列

css - 如何从跨度中删除默认的 margin-left?

javascript - 在 bootstrap 网格中将 div 包裹在大 div 周围

jquery - 尝试使用 jQuery 调整背景大小