我正在使用Bootstrap 3手风琴.一切都很好,除了转换不顺利.这就像跳跃过渡.我怎样才能顺利过渡?
<div class="panel" id="<?PHP echo $id; ?>"> <div class="panel-title"><?PHP the_title(); ?></div> <div id="collapse-<?PHP echo $id; ?>" class="panel-collapse collapse" style="overflow:hidden; display: block;"> <div class="panel-body"><?PHP the_content(); ?></div> </div> <a data-toggle="collapse" data-parent="#accordion" href="#collapse-<?PHP echo $id; ?>" class="collapsed read_more" id="btn-collapse-<?PHP echo $id; ?>">Read More »</a> </div>
JS
$('.panel-collapse').on('shown.bs.collapse',function () { var collapse_id = $( this ).attr("id"); $(".panel > #btn-"+collapse_id).text("Close"); }); $('.panel-collapse').on('hidden.bs.collapse',function () { var collapse_id = $( this ).attr("id"); $(".panel > #btn-"+collapse_id).text("Read More"); });
我确实遵循了official site的所有内容.
我试过的:
这个tranisiton CSS崩溃类
.panel .collapsing{ height: 100px !important; -moz-transition : height 5s; -webkit-transition : height 5s; -o-transition : height 5s; transition : height 5s; }
解决方法
只是更新过渡应该有效
.collapsing { transition: height 0.6s; }