Created
August 23, 2011 14:42
-
-
Save timruffles/1165302 to your computer and use it in GitHub Desktop.
Pure css3 popup element
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
<style> | |
.wrap { | |
-webkit-transition: all 1s; | |
position:absolute; | |
bottom: 0; | |
height: 0; | |
width: 0; | |
overflow: hidden; | |
-webkit-transition-delay: 1s; | |
} | |
.thing { | |
height: 200px; | |
width: 200px; | |
background: red; | |
position: absolute; | |
bottom: 0; | |
-webkit-transform: translate(0px,400px); | |
-webkit-transition: all 1s; | |
} | |
.wrap.shown { | |
height: 400px; | |
width: 400px; | |
-webkit-transition-delay: 0s; | |
} | |
.shown .thing { | |
-webkit-transform: translate(0px,0px); | |
} | |
</style> | |
<button onclick="document.querySelectorAll('.wrap')[0].classList.toggle('shown')">Show</button> | |
<div class="wrap"> | |
<div class="thing"> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment