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

155
Views
Any easier way to create CSS value change animations with javascript

So I love animating my pages using JavaScript and changing CSS rules with it by having a transition rule.

Only problem is, if I need 2 changes simultaneously I need to delay them. Is there a more efficient (bug proof) way of doing this? Is it wrong, and perhaps is there a similar alternative?

.welcome{
    opacity: 0;
    position: absolute;
    top: 48%;
    left: 50%;
    transform: translate(-50%, -50%);

    transition: top .4s, opacity .6s;
}


    content.style.transform = "translateY(20px)"
    content.style.opacity = 0

    setTimeout(() => {
        content.style.transition = "initial"
        content.style.transform = "translateY(-20px)"
        setTimeout(() => {
            content.style.removeProperty("transition")
            content.style.removeProperty("transform")
            content.style.opacity = 1
            content.innerHTML = ""
            content.appendChild(motd)
        }, 10);
    }, 300);
about 4 years ago · Santiago Gelvez
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!