1.针对height的transition
需要指定一个明确的初始和结束状态,例如 height: auto; 这样不确定的末状态无法使“transition: height, 0.5s;” 生效,解决方法是为初末状态设置max-height,transition监控状态也改为max-height:
.coupon-site-pick {
max-height: 0;
-webkit-transition: max-height 0.5s;
-moz-transition: max-height 0.5s;
-ms-transition: max-height 0.5s;
-o-transition: max-height 0.5s;
transition: max-height 0.5s;
}
.coupon-site-pick.use {
max-height: 150vh;
}
网友评论