Created
February 26, 2014 01:40
-
-
Save robsonsobral/9221734 to your computer and use it in GitHub Desktop.
transition using width or height auto
This file contains hidden or 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
/** | |
* transition using width or height auto | |
*/ | |
ul,li { | |
display: block; | |
margin: 0; | |
padding: 0; | |
width: 250px; | |
} | |
li { | |
border-bottom: 1px solid lightgrey; | |
} | |
li > ul { | |
max-height: 0; | |
overflow: hidden; | |
text-indent: .5em; | |
transition: max-height 1s; | |
} | |
li:hover > ul { | |
max-height: 1000px; | |
} |
This file contains hidden or 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
<ul> | |
<li>item | |
<ul> | |
<li>sub-item</li> | |
<li>sub-item</li> | |
</ul> | |
</li> | |
<li>item | |
<ul> | |
<li>sub-item</li> | |
<li>sub-item</li> | |
<li>sub-item</li> | |
<li>sub-item</li> | |
</ul> | |
</li> | |
<li>item | |
<ul> | |
<li>sub-item</li> | |
<li>sub-item</li> | |
<li>sub-item</li> | |
<li>sub-item</li> | |
<li>sub-item</li> | |
</ul> | |
</li> | |
<li>item | |
<ul> | |
<li>sub-item</li> | |
<li>sub-item</li> | |
</ul> | |
</li> | |
<li>item | |
<ul> | |
<li>sub-item</li> | |
<li>sub-item</li> | |
<li>sub-item</li> | |
</ul> | |
</li> | |
<li>item | |
<ul> | |
<li>sub-item</li> | |
<li>sub-item</li> | |
<li>sub-item</li> | |
</ul> | |
</li> | |
</ul> |
This file contains hidden or 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
// alert('Hello world!'); |
This file contains hidden or 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
{"view":"split-vertical","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment