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

381
Vistas
React - When we mouseover an element, how to select multiple elements except the we hover over?

I am currently trying to replicate a function of the Netflix homepage:

We have several rows of movies. When we don't mouseover any movie, the movie images stay normal. But when we hover over a movie, the current image scales up and all the other ones in this row to get their opacity reduced. When we "onMouseOut" the row, everything gets back to normal

I am currently wondering how to implement that into an onMouseOver function. If anyone has an idea, that'd very helpful.

PS: I also use Swiper JS.

Thank you for your help.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

The solution could be to add a class to that element during the onMouseOver event. This way you can easily select what elements you would like to stylize.
You could also add a class name to the container so that you could select all elements without selected class or without a hover. Please try the one below, it seems to be the simplest:

.container:hover > .item:not(:hover) { 
  opacity: 0.5;
}

Please see the codepen below:

https://codepen.io/damianbartosik/pen/JjrzrZd

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