Last active
August 29, 2015 14:22
-
-
Save gustaff-weldon/43fb81fd4411921a47a6 to your computer and use it in GitHub Desktop.
Untitled
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
@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; | |
} |
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
<button class="trigger">Toggle</button> | |
<div class="menu collapsed"></div> |
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
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) |
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","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