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

348
Views
¿Cómo cambio el tiempo de transición de un elemento en JavaScript?

Digamos que tengo un elemento con:

 .element{ /* some css prorieties */ transition-duration:1.5s; transition-delay:.1s; }

Ahora, al activarlo al pasar el cursor sobre otro elemento, quiero que entre con esta duración y retraso, pero que salga (ya no se desplace) un poco más rápido.

Ahora deja que bigobj=the object sobre el que paso el mouse

y

let smallobj=the object que hace la transición ( .element )

Mi JS se ve así:

 bigobj.addEventListener('mouseleave',function(){ smallobj.style.transitionDuration=.3; smallobj.style.transitionDelay=.3; });

no funciona

Si lo cambio a:

 smallobj.style.transition="none";

funciona según lo previsto.

¿Cuál sería una solución?

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!