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

180
Vistas
Infinite autoplay slider React js

Rows Image

In the above picture, I want the rows to move to the left infinitely.

Below is the component code:

 <div id={id} className="row__posters">
          {movies.map((movie) => (
            <img
              key={movie.id}
              onClick={() => handleClick(movie)}
              className={`row__poster ${isLargeRow && "row__posterLarge"}`}
              src={`${base_url}${
                isLargeRow ? movie.poster_path : movie.backdrop_path
              }`}
              loading="lazy"
              alt={movie.name}
            />
          ))}
        </div>

And here is the css for the component code:

.row {
  color: white;
  margin-left: 20px;
}
.row__posters {
  display: flex;
  overflow-y: hidden;
  overflow-x: scroll;
  padding: 20px;
}
.row__posters::-webkit-scrollbar {
  display: none;
}

.row__poster {
  max-height: 100px;
  object-fit: contain;
  margin-right: 10px;
  transition: transform 450ms;
}
.row__poster:hover {
  transform: scale(1.08);
  opacity: 1;
}
.row__posterLarge {
  /* overflow-x: scroll; */
  max-height: 250px;
  /* width: calc(250px * 20); */
  animation: scroll 40% linear =infinite;
}
.row__posterLarge:hover {
  transform: scale(1.09);
  opacity: 1;
}
@keyframes scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(calc(-250px * 10));
  }
}

I want the large row to have an infinite autoplay slider and the other rows shouldn't be affected. I tried (https://www.youtube.com/watch?v=3Z780EOzIQs) but nothing happened. Then I tried react-slick third party (https://react-slick.neostack.com/docs/example/pause-on-hover) and it only broke the rows, it turned them into one column(left-aligned).

Do you have any ideas on how to implement this feature?

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

0

You can use react-slick for that. If you want to make it infinite scroll. You have to change the settings object. Which you pass inside the Slider Component. Add these two inside the setting -

autoplay: true, autoplaySpeed: 2000,

to make it infinite scroll you can use -

infinite: true,

You should also mention how many slides to show.

slidesToShow: 3, slidesToScroll: 1,

Make sure those properties are these. And you have imported css file inside you component.

import "slick-carousel/slick/slick.css"; import "slick-carousel/slick/slick-theme.css";

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