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

208
Vistas
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 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