我使用的是 angular 5 和 ngx-bootstrap,所以当我尝试添加 collpase 时,按照折叠 docs ,我得到了一个工作示例,但没有动画(折叠消失并立即出现,没有效果)。
那么有没有办法显示动画呢?
最佳答案
这可能是整个项目的解决方案。
.collapse {
transition: all 0.3s ease-out;
display: block !important;
overflow: hidden !important;
max-height: 0;
}
.collapse.in {
transition: all 0.5s ease-in;
max-height: 9999px; /*any number which is lager than a height of any of your elements*/
}
关于Angular ngx-bootstrap 崩溃不是动画,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49481302/