Created
February 3, 2012 18:38
-
-
Save ginader/1731652 to your computer and use it in GitHub Desktop.
fade in from display:none(ish)
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
/** | |
* fade in from display:none(ish) | |
* taken from http://jsfiddle.net/Schepp/KFja4/ | |
*/ | |
body{ | |
margin-top:3em; | |
} | |
span { | |
display: inline-block; | |
overflow: hidden; | |
max-width: 0; | |
margin-right: -0.25em; | |
opacity: 0; | |
transition-property: max-width, margin-right, opacity; | |
transition-duration: 0, 0, 0.5s; | |
transition-delay: 0.5s, 0.5s, 0; | |
} | |
p:hover span { | |
max-width: 9999px; | |
margin-right: 0; | |
opacity: 1; | |
transition-delay: 0, 0, 0.5s; | |
} |
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
<!-- content to be placed inside <body>…</body> --> | |
<p>Hover on me! Lorem ipsum <span>dolor</span> sit amet</p> |
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","prefixfree":"1","page":"css"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment