【问题标题】:How to animate height change on Bootstrap 3 Carousel如何在 Bootstrap 3 Carousel 上设置高度变化动画
【发布时间】:2014-05-03 14:08:33
【问题描述】:

我知道有this 的问题。不幸的是,为 Bootstrap 3 提出的解决方案doesn't work(尽管它为 bs 2.3.1 提供了does)。那我该怎么做呢?

【问题讨论】:

    标签: javascript css twitter-bootstrap twitter-bootstrap-3


    【解决方案1】:

    可以用一个简单的 JavaScript 片段来解决这个问题:

    function bsCarouselAnimHeight()
    {
        $('.carousel').carousel({
            interval: 5000
        }).on('slide.bs.carousel', function (e)
        {
            var nextH = $(e.relatedTarget).height();
            $(this).find('.active.item').parent().animate({ height: nextH }, 500);
        });
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-03-23
      • 1970-01-01
      • 1970-01-01
      • 2019-02-20
      • 2016-02-17
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多