I'm trying to replicate this effect using CSS effects or transitions.
Using animations I can animate the
opacity, but only fadeIn, and the
height (which should control the slide) doesn't seem to work at all :(
height doesn't work either. And there seems to be a slight delay on animation start.
Any other ideas?
You can't currently animate on height when one of the heights involved is auto, you have to set two explicit heights. There's an extensive workaround posted as an answer to this similar question.
I made an alteration to your JS Fiddle, I beleive this is what you want; please see it here.
-moz-transition:height 1s opacity 1s;
-webkit-transition:height 1s opacity 1s;
-o-transition:height 1s opacity 1s;
-ms-transition:height 1s opacity 1s;
transition:height 1s, opacity 1s;
I added a few vendor prefixes to the transition CSS propery as I'm not sure what browser you'll be using and I'm on firefox so I need the -moz- prefix lol :)
The only problem I can see with this is that height:auto or height:100% doesn't animate, so you'll need to specify ems or px... If this is going to be a problem (like if the content will be dynamic), I would advise using jQuery for the height animation.
Discussion courtesy of: Dan
This recipe can be found in it's original form on Stack Over Flow.