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

279
Vistas
Slick Carousel: is it possible to scroll the carousel item into the center without centerMode: true?

With Slick Carousel - is it possible to scroll the carousel item into the center (e.g. with option focusOnSelect) without using centerMode: true?

The reason I ask is that with the following configuration:

{
  focusOnSelect: true,
  centerMode: true,
  infinite: true,
  variableWidth: true
}

Particularly - I think - with variableWidth: true, I end up with an initial slide layout that has overflows on both sides. I want to have no overflow on the left side initially, as this would conform to the design that begins in the center of the screen and stretches until the right side of the screen.

Simply put, when you click on a slide, it should focus in the center, rather than on the left (which seems confusing from a UX-perspective in my opinion), without forcing the slides to begin centered.

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

0

Assuming you have a component template with VueSlickCarousel e.g.

<template>
  <VueSlickCarousel v-bind="settings" ref="carousel" @reInit="onCarouselReInit">
    ...your slides...
  </VueSlickCarousel>
</template>

Your data may have a settings object with focusOnSelect: true.

You can set up the following reInit handler method to keep things centered without having the initial render centered:

  methods: {
    /**
     * Center the carousel slide without having the carousel be in centerMode
     * on initial render.
     */
    onCarouselReInit () {
      this.carouselInitiated = true

      // Set centerMode without triggering a re-render.
      this.$refs.carousel.$refs.innerSlider.$data.centerMode = true
    },

This works because VueSlickCarousel watches your configuration props and re-renders automatically, so you can't dynamically set centerMode this way. Instead, you dig deeper to the inner InnerSlider component and set the property there.

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