Skip to content

Instantly share code, notes, and snippets.

@timruffles
Created August 23, 2011 14:42
Show Gist options
  • Save timruffles/1165302 to your computer and use it in GitHub Desktop.
Save timruffles/1165302 to your computer and use it in GitHub Desktop.
Pure css3 popup element
<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