Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

123
Vistas
How to run css transition using javascript when element is in the middle of the screen

I'm currently making my website more mobile-friendly, but :hover doesn't work on mobile. I have buttons and other elements with hover transition effects so I thought the next best solution would be running the effect when the element is in the middle of the user's screen, like how on the youtube app it will start playing the beginning of a video if it is in the middle of your screen. How do I use Javascript to detect when an element is vertically in the middle of a user's screen, let's say somewhere in the range of 300px to 600px, and to apply a css transition, like changing the color from white to red over 1 second?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda