注意:当height设置为0或者auto时,transition是不生效的,如何实现简单的展开效果
tricks:利用maxHeight属性
.description {
max-height: 0;
transition: max-height 1s;
overflow: hidden;
}
.description.active {
max-height: 300px;
}
注意:当height设置为0或者auto时,transition是不生效的,如何实现简单的展开效果
tricks:利用maxHeight属性
.description {
max-height: 0;
transition: max-height 1s;
overflow: hidden;
}
.description.active {
max-height: 300px;
}