Skip to content

Instantly share code, notes, and snippets.

@edinsoncs
Last active April 1, 2016 15:52
Show Gist options
  • Select an option

  • Save edinsoncs/abb55c07fe1ea77066cf0e623905a607 to your computer and use it in GitHub Desktop.

Select an option

Save edinsoncs/abb55c07fe1ea77066cf0e623905a607 to your computer and use it in GitHub Desktop.
Menu Animation
Javascript
function menu(){
function selectItemClick(item){
return item;
}
function showItemMenu(item){
return item;
}
function hideItemMenu(item){
return item;
}
function iconItemMenu(item) {
return item;
}
$(selectItemClick('.jsIconOne')).click(function(){
$(iconItemMenu('.jsIconOne')).fadeOut(0);
$(showItemMenu('.cga__Menu--E')).css('display','block').animate({
easing: 'swing',
right: '17em'
});
$(selectItemClick('.jsMenu')).addClass('animacionMenuE');
$(".jsIconTwo").fadeIn(0);
});
$(hideItemMenu('.jsIconTwo')).click(function(){
$(showItemMenu('.cga__Menu--E')).animate({
easing: 'swing',
right: '0'
});
$(selectItemClick('.jsMenu')).addClass('animacionMenuE');
$(iconItemMenu('.jsIconTwo')).fadeOut(0);
$(".jsIconOne").fadeIn(0);
});
}
menu();
CSS//
.animacionMenuE {
animation: Eborder 2s infinite;
border-top: 2px solid white;
border-bottom: 2px solid white;
border-left: 2px solid white;
border-right: 2px solid white;
border-radius: 50%;
transition: all 0.5s linear;
padding: 0.5em 0.5em 0.3em 0.5em;
}
@keyframes Eborder {
0% {
transform: rotate(0deg);
border-right: 2px solid transparent;
}
20% {
border-left: 2px solid transparent;
}
30% {
border-top: 2px solid transparent;
}
40% {
border-bottom: 2px solid transparent;
}
100% {
transform: rotate(360deg);
}
}
.jsIconTwo {
display: none;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment