I'm using the technique of transitioning the max-height instead of the height because of varying content height but I have a problem.
Inside the element that grows or shrinks I have an absolute positioned element that overflows, and I want to show that element when the parent element is expanded.
The problem is that if I only set the overflow hidden when the element is not expanded, it jumps because of the transition. Here's a pen where you can see it jump:
https://codepen.io/nicopavlotsky/pen/pozLBxY
with this code:
div{
transition: all .5s;
overflow: hidden;
}
div.active{
overflow: visible;
max-height: 10rem;
}
and here's another one where it doesn't have the jump but the children element is cut out:
https://codepen.io/nicopavlotsky/pen/yLBKrGW
div{
transition: all .5s;
overflow: hidden;
}
div.active{
max-height: 10rem;
}
is there a JS less way to do this?