Skip to content

Instantly share code, notes, and snippets.

@ozzyrod
Last active January 25, 2017 20:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ozzyrod/b1fa7e68a27cbb53bc09c1b3b497beb0 to your computer and use it in GitHub Desktop.
Save ozzyrod/b1fa7e68a27cbb53bc09c1b3b497beb0 to your computer and use it in GitHub Desktop.
max-height transitions
.show-hide-content {
height: auto; /* this should be set already, but just in case it isn't, it's necessary to have the height set to auto for this to work */
max-height: 180px; /* Set this to whatever you want the height to start off as */
overflow: hidden;
transition: max-height 0.2s ease-in-out;
}
.show-hide-content.full { /* The class "full" should be added with JS */
max-height: 100vh;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment