Please see this fiddle:
div {
width:300px;
}
.upper {
height:50px;
background-color: red;
}
.middle {
height: 100px;
background-color: green;
}
.bottom {
height: 900px;
background-color: purple;
}
<div class="upper">
</div>
<div class="middle">
</div>
<div class="bottom">
</div>
I need a way to make an entrance for the green element: At first, it doesn't appear, then it appears and grows in-place and it pushes down the red element.
The only solution I found is to animate max-height
property from 0px to other value.
However, this solution is not the best because it causes layout thrashing
So I need to figure out how is it possible to do this with transform
somehow.
another information - the height of the green element is not known, so the solution preferably not hard code its height.