单击幻灯片时,Bootstrap Carousal消失

时间:2019-06-12 10:00:43

标签: ruby-on-rails twitter-bootstrap

离开幻灯片自动播放时没有问题,但是当我单击单个幻灯片时,所有内容都会消失。

  <!-- Indicators -->
  <ul class="carousel-indicators">
    <% @job.images.each_with_index do |image, index| %>
    <li data-target="#carouselExampleControls" data-slide-to=#{index} <%= index == 0 ? 'class="active"' : '' %>></li>
    <% end %>
  </ul>

  <!-- The slideshow -->
  <div class="carousel-inner">
    <% @job.images.each_with_index do |image, index| %>
    <div class="item <%= index == 0 ? 'active' : '' %>">
    <%= image_tag image , size: 200 %>
    </div>
    <% end %>
  </div>


  <!-- Left and right controls -->
  <a class="carousel-control-prev" href="#carouselExampleIndicators" 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="#carouselExampleIndicators" role="button" data-slide="next">
    <span class="carousel-control-next-icon" aria-hidden="true"></span>
    <span class="sr-only">Next</span>
  </a>

</div>

0 个答案:

没有答案