【问题标题】:Using different intervals for carousels in Twitter Bootstrap在 Twitter Bootstrap 中使用不同的轮播间隔
【发布时间】:2013-03-14 23:42:56
【问题描述】:

我目前遇到的问题是,我的引导文档中有两个轮播,每个轮播都有唯一的 id 和类(#myCarousel-1、#myCarousel-2 / .carousel-1、.carousel-2) . 我使用以下代码定位轮播:

<script type="text/javascript">
    $('#myCarousel-1').carousel({
        interval: 2000
    })
</script>
<script type="text/javascript">
    $('#myCarousel-2').carousel({
        interval: false
    })
</script>

问题在于 id 或 class 都不是针对特定 div 的。两个轮播开始间隔滑动。任何想法如何避免这种情况?

PS:我在这个提示之后更改了 id 和类:Is it possible to have multiple Twitter Bootstrap carousels on one page?

【问题讨论】:

    标签: jquery twitter-bootstrap carousel


    【解决方案1】:

    你可以说我偶然找到了解决方案。在你的 html 中写下以下内容:

    <script type="text/javascript">
        $(document).ready(function(){
            $('#myCarousel-1').carousel({
                interval: 2000
            })
            $('#myCarousel-2').carousel({
                interval: false
            })
        });
    </script>
    

    你可以走了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-05-26
      • 1970-01-01
      • 1970-01-01
      • 2013-06-25
      • 2023-03-23
      • 2012-08-15
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多