A common approach for making a SlideUp transition is the following:
.cssSlideUp {
transition: .5s linear all;
height: 80px;
overflow: hidden;
}
.cssSlideUp.hide {
height:0;
}
This approach requires the element to have a fixed height (80px
).
What approach allows me to have the same effect but with a flexible height?
Update:
This works, but I'm still not satisfied. The max-height:400px
property still fixes the height on a specified number, and doing max-height:9999px
to make it "infinite" will make the transition unnoticeable:
.cssSlideUp {
transition: .5s linear all;
height: auto;
max-height: 400px;
overflow: hidden;
}
.cssSlideUp.ng-hide {
max-height: 0px;
}
Update 2:
A scale transform works well, but I'm still not satisfied, since it won't push/pull the elements below:
.cssSlideUp {
transition: .5s linear all;
transform: scaleY(1);
transform-origin: top;
overflow: hidden;
}
.cssSlideUp.ng-hide {
transform: scaleY(0);
}