I'm having an issue with a transition I'm using to slide a panel in and out.
Please take a look at the following jsbin http://jsbin.com/uvejuj/1/
Notice that when i click the toggle button the first time the transition occurs immediately.
However if i click the button again to close then the transition delays the amount of time of the transition before it executes.
What is causing the delay on close out and how can i get rid of it?
Thanks
Fixed JS Bin
Fix delay solution:
Put cubic-bezier(0, 1, 0, 1) transition function for element.
.text {
overflow: hidden;
max-height: 0;
transition: max-height 0.5s cubic-bezier(0, 1, 0, 1);
&.full {
max-height: 1000px;
transition: max-height 1s ease-in-out;
}
It's because you're animating between 0 and 1000px max height but your content is only about 120px high. The delay is the animation happening on the 880 pixels that you can't see.
Either set max-height to the known height of your content (if you know it - example: http://jsbin.com/onihik/1/) or try a different method. Maybe something like https://stackoverflow.com/a/6486082/2619379
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With