如何使用bootstrap减少滑动时间?

时间:2014-09-17 05:09:24

标签: jquery twitter-bootstrap

这是我的工作代码,但我想让它慢慢滑下或根据我给出的时间

See my example

JS:

$('.container a').click(function () {
    var $target = $($(this).data('target'));
    if (!$target.hasClass('in')) $('.container .in').removeClass('in').height(0);
},
5000);

1 个答案:

答案 0 :(得分:2)

您可以根据需要覆盖以下css。默认速度为0.35秒。

.collapse{
-webkit-transition:height 0.35s ease;
-moz-transition:height 0.35s ease;
-o-transition:height 0.35s ease;
transition:height 0.35s ease;
}

<强>更新

Bootstrap 3.2.0版开始使用.collapsing代替.collapse

DEMO