Created
December 12, 2014 16:39
-
-
Save rustedwolf/e895bc43a4cd795fd50e to your computer and use it in GitHub Desktop.
Fluid css fold/unfold animation when having auto height
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Credits goes to +RichBradshaw, from whom I've learned this technique | |
*/ | |
.container .hidden-container { | |
max-height: 0; | |
overflow: hidden; | |
transition: max-height 0.2s ease; /* reverse transition*/ | |
/* remember not to put any borders, paddings here*/ | |
} | |
.container:hover .hidden-container { | |
max-height: 999px; /* enter bigger value if necessary, but don't over do as it impacts the animation speed! */ | |
transition: max-height 0.5s ease; /* forward transition */ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment