javascript - 我的轮播 "next"按钮不起作用,并且我的轮播没有自动转换

标签 javascript carousel

我正在尝试编写一个轮播,但它不起作用,下一个/上一个按钮和自动幻灯片都不起作用

<div class="container-fluid">

    <div class="row">
      <div class="col-md-12">
        <!--Slideshow starts here-->
        <div class="bd-example">
           <div id="carouselExampleCaptions" class="carousel slide" data-ride="carousel">

            <ol class="carousel-indicators">
              <li data-target="#carouselExampleCaptions" data-slide-to="0" class="active"></li>
              <li data-target="#carouselExampleCaptions" data-slide-to="1"></li>
              <li data-target="#carouselExampleCaptions" data-slide-to="2"></li>
            </ol>

            <div class="carousel-inner">

              <div class="carousel-item active">
                <img src="/Users/catherinekorren/Desktop/WebDesign/i6_local/cause/bootstrap/images/dj.gif" class="d-block w-100" alt="DJ">
                <div class="carousel-caption d-none d-md-block">
                  <h5>Music Can Change Lives</h5>
                  <p>Whether You're A DJ</p>
                </div>
              </div>

              <div class="carousel-item">
                <img src="/Users/catherinekorren/Desktop/WebDesign/i6_local/cause/bootstrap/images/crowd.gif" class="d-block w-100" alt="Black Hole 1">
                <div class="carousel-caption d-none d-md-block">
                  <h5>Or a Listener</h5>
                  <p>Anywhere Across the World</p>
                </div>
              </div>

              <div class="carousel-item">
                <img src="img/blackhole.jpg" class="d-block w-100" alt="Black Hole 3">
                <div class="carousel-caption d-none d-md-block">
                  <h5>Third Hole</h5>
                  <p>This is another artist...</p>
                </div>
              </div>

            </div>

            <a class="carousel-control-prev" href="#carouselExampleCaptions" role="button" data-slide="prev">
              <span class="carousel-control-prev-icon" aria-hidden="true"></span>
              <span class="sr-only">Previous</span>
            </a>

            <a class="carousel-control-next" href="#carouselExampleCaptions" role="button" data-slide="next">
              <span class="carousel-control-next-icon" aria-hidden="true"></span>
              <span class="sr-only">Next</span>
            </a>

          </div>
        </div>
       <!-- Slideshow ends here -->
      </div>
    </div>

最佳答案

enter image description here

希望这段代码可以有所帮助。您可以更改时间间隔。

关于javascript - 我的轮播 "next"按钮不起作用,并且我的轮播没有自动转换,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55944443/

相关文章:

javascript - JQuery 脚本错误

javascript - 如何构造返回常量字符串的 Bluebird Promise?

html - 有没有办法在没有 JS 或 Jquery 的情况下修改它?

css - bootstrap 第二轮播 其他 css 规则

javascript - 限制 JavaScript 只能在元素内工作

javascript - 云函数本地 HTTP 触发器

amazon-web-services - 在 AWS Lex 中创建轮播卡片

html - 内部带有翻转效果的 Bootstrap 轮播

jquery - 如何启用水平滑动来 Bootstrap 轮播?

javascript - 使用 MediaStream Recording API 进行最低延迟音频播放/监控的一组好的约束是什么?