Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

189
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!