Skip to content

Instantly share code, notes, and snippets.

@gustaff-weldon
Last active August 29, 2015 14:22
Show Gist options
  • Save gustaff-weldon/43fb81fd4411921a47a6 to your computer and use it in GitHub Desktop.
Save gustaff-weldon/43fb81fd4411921a47a6 to your computer and use it in GitHub Desktop.
Untitled
@keyframes slide-up-fade-in {
0% { display:none; opacity: 0.25; }
1% { display: block ; opacity: 0; }
100% { display: block ; opacity: 1; }
}
.menu {
height: 100px;
background: red;
}
.animation {
transition: all 0.3s ease-out;
}
.collapsed {
opacity: 0;
transform: translateY(100px);
}
.trigger {
padding: 10px;
}
<button class="trigger">Toggle</button>
<div class="menu collapsed"></div>
var trigger = document.querySelector('.trigger');
var menu = document.querySelector('.menu');
var open = 0;
trigger.addEventListener('click', function() {
open = !open;
if(open) {
menu.classList.remove('collapsed');
} else {
menu.classList.add('collapsed');
}
}, false)
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment