Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

190
Visualizações
how to use javascript to make an animation on hover

Hey so I have a div which I want to animate when its being hovered over.

at the moment it says 'logged in as username' but I want to make it so that when I hover over it (im using animate.style) the text fades to the right and a button saying sign out comes in its location where the person can click to sign out but if they hover out of the div for things to go back to the way they were with the same animation.

but I get lots of bugs like, the text constantly changing and bugging out when moving mouse close to it.

function loggedInHover() {
                    let signin = document.getElementById("signin");
                    signin.classList.add("animate__animated", "animate__fadeOutRight");
                    setTimeout(function() {
                        signin.style.display = "none";
                        signin.innerHTML = "Sign Out";
                        signin.style.display = "block";
                        signin.classList.remove("animate__fadeOutRight");
                        signin.classList.add("animate__animated", "animate__fadeInLeft");
                    }, 1000);
                }
            function loggedInOut() {
                    let signin = document.getElementById("signin");
                    signin.classList.add("animate__animated", "animate__fadeOutRight");
                    signin.style.display = "none";
                    signin.innerHTML = "logged in as <strong class=\"h3\">{{ user.username }}</strong>";
                    signin.style.display = "block";
                    signin.classList.remove("animate__fadeOutRight");
                    signin.classList.add("animate__animated", "animate__fadeInLeft");
                }
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda