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

157
Views
Otro error de JavaScript: agregar la transición al elemento genera 0 adicionales

Usando estas líneas, traté de agregar transiciones al elemento:

 transition.style.transform = 'translateY(0)'; transition.style['-webkit-transition'] = 'opacity 0.9s ease-in-out'; setTimeout(() => { type == 'showContainer' ? transition.style.opacity = 1 : transition.style.opacity = 0; }, 100);

Pero establece la transición de esta manera:

 element.style { transform: translateY(0px); transition: opacity 0.9s ease-in-out 0s; opacity: 1; }

¡Los 0 adicionales están incluidos y arruinan la transición! ¿Cómo puedo arreglar esto?

Solo quiero agregar una transición de opacidad simple ;(

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Un par de cosas:

Para establecer la propiedad de estilo con su nombre css, use style.setProperty(property, value) . Para configurarlo directamente con javascript, las propiedades tienen diferentes nombres, como backgroundColor en lugar de background-color .

¿Por qué usas un tiempo de espera? Puede establecer directamente la opacidad y la transición. No habrá problemas de tiempo.

Utilice transition en lugar de -webkit-transition . Es compatible con todos los navegadores. Y se puede configurar directamente en la propiedad de estilo.

about 4 years ago · Juan Pablo Isaza Report
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!