Hello everyone. Thanks in advance for your help.
In the link I have attached, I am trying to animate the menu bar. The idea is that each time you click on a link, the bar disappears completely and reappears.
Problems: The animation is done once at the beginning and then it is not repeated. Maybe it's because I have not managed to remove the class ('disappear) or because of the fixed position of the object?
HTML
<nav class="menu menu--antonio header-nav-wrap">
<ul class="menu__list header-nav">
<li class="menu__item menu__item--current"><a href="#home" class="menu__link smoothscroll" id="uno">Starseite</a></li>
<li class="menu__item"><a href="#about" class="menu__link smoothscroll" id="dos">Über mich</a></li>
<li class="menu__item"><a href="#interactive" class="menu__link smoothscroll" id="tres">Interaktiv</a></li>
<li class="menu__item"><a href="#course" class="menu__link smoothscroll" id="cuartro">Coaching</a></li>
<li class="menu__item"><a href="#kontakt" class="menu__link smoothscroll" id="cinco">Kontakt</a></li>
<li class="menu__line"></li>
</ul>
</nav>
JS (JQuery)
$(document).ready(function () {
$allDocument = $(window);
$desplazamiento = $('.smoothscroll');
var cabecera = $('.main-header');
$desplazamiento.click(function(e){
$('body,html').animate({
scrollTop: $(this.hash).stop().offset().top
},1500);
cabecera.addClass('desaparece');
});
CSS
.desaparece {
animation-name: fadeIn;
-moz-animation-name: fadeIn;
-webkit-animation-duration: 3s;
animation-duration: 3s;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
-webkit-animation-timing-function: ease-in-out;
animation-timing-function: ease-in-out;
}
Thanks for your help. Greetings