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

145
Vistas
Splide slider broke when there is a product with variations. It works normally

I'm currently working on this website and using Splide.Js Slider to create my product image slider.

The slider slides is populated with dynamic data from the webflow database.

Long story short, if a product has no variations it works fine but when a product has some sort of variations, it shows the images of the particular variation selected but the functionality seems to have some kind of problem.

I can't see where is the problem as it changes the images correctly. Maybe there is some sort of conflict but I'm a newbie in JS and can't make a correct debug of it.

You can see an example of the product that has no variations here: https://santo-ecommerce.webflow.io/product/no-sleep-poster

You can see the broken slider in the product with variations here: https://santo-ecommerce.webflow.io/product/no-sleep-t-shirt

For reference I've a carousel that has this HTML structure:

<section class="splide slider2" aria-label="Basic Structure Example">
  <div class="splide__track">
    <ul class="splide__list">
      <li class="splide__slide">Slide 01</li>
      <li class="splide__slide">Slide 02</li>
      <li class="splide__slide">Slide 03</li>
    </ul>
  </div>
</section>

The JS that make the splider slider work is this:

<script>
function slider2() {

let splides = $('.slider2');
for ( let i = 0, splideLength = splides.length; i < splideLength; i++ ) {
    new Splide( splides[ i ], {
  // Desktop on down
    perPage: 1,
    perMove: 1,
  focus: 'center', // 0 = left and 'center' = center
  type: 'loop', // 'loop' or 'slide'
  gap: '4em', // space between slides
  arrows: 'slider', // 'slider' or false
  pagination: 'slider', // 'slider' or false
  speed : 550, // transition speed in miliseconds
  dragAngleThreshold: 80, // default is 30
  autoWidth: false, // for cards with differing widths
  rewind : false, // go back to beginning when reach end
  rewindSpeed : 800,
  waitForTransition : false,
  updateOnMove : true,
  trimSpace: false,
  breakpoints: {
        991: {
        // Tablet
            perPage: 3,
      gap: '4vw',
        },
    767: {
        // Mobile Landscape
            perPage: 1,
      gap: '4vw',
        },
    479: {
        // Mobile Portrait
            perPage: 1,
      gap: '4vw',
        }
    }
} ).mount();
}

}
slider2();

</script>

If you can help me find what's the issue with the slider in the product with variations I will be extremely grateful.

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