Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

152
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda