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

209
Visualizações
Swiper.js slider with only one image visible at a time

I would like to create a slider with swiper.js library that contains images of the same height but variable widths; only one image at a time should be visible (no cropped images at the sides of the slider), navigation arrows should appear to the left and the right of each slide and the slide should be left-aligned (not centered). Desired layout:

enter image description here

But the layout I could manage is like this: enter image description here

As you can see, the slider container has a fixed width and so the right arrow doesn't adapt to the width of the actual slide. These are my slider settings:

const swiper = new Swiper('.swiper', {
  // Optional parameters
  slidesPerView: '1',
  centeredSlides: false,
  spaceBetween: 25,
  keyboard: true,
  freeMode: true,
  // Navigation arrows
  navigation: {
    nextEl: '.swiper-button-next',
    prevEl: '.swiper-button-prev',
  },
});

And you can see it at work in this fiddle:

https://jsfiddle.net/madamadam/59xoht4j/

How can I achieve my desired layout? If it's not possible with slider.js, I appreciate other libraries/solutions as well.

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