【问题标题】:Bootstrap Carousel in Rails suddenly stopped workingRails 中的 Bootstrap Carousel 突然停止工作
【发布时间】:2012-08-05 00:10:12
【问题描述】:

我在 Rails 应用程序中的轮播直到不久前还在工作,现在下一个和上一个按钮不起作用。未对此视图或 CSS 中的轮播进行任何更改。

这是我的代码:

.carousel.slide#myCarousel
 .carousel-inner
  .active.item
    =image_tag("/assets/1.jpg")
    .carousel-caption
      %h4 Caption
  .item
    =image_tag("/assets/2.jpg")
    .carousel-caption
      %h4 Caption
  .item
    =image_tag("/assets/3.jpg")
    .carousel-caption
      %h4 Caption

 %a.carousel-control.left{"data-slide" => "prev", :href => "#myCarousel"} ‹
 %a.carousel-control.right{"data-slide" => "next", :href => "#myCarousel"} ›

【问题讨论】:

    标签: ruby-on-rails-3 twitter-bootstrap


    【解决方案1】:

    发现这个解决方案对我有用:

    https://stackoverflow.com/questions/9353294/bootstrap-carousel-not-working

    在我的标题中使用了这个:

    <script>
    $(function(){
      $('#myCarousel').carousel();
    });
    </script>
    

    【讨论】:

      猜你喜欢
      • 2018-07-13
      • 2023-03-21
      • 1970-01-01
      • 2017-08-22
      • 2021-02-01
      • 2016-12-29
      • 2018-05-09
      • 2015-12-07
      相关资源
      最近更新 更多