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.
Assuming you have a component template with VueSlickCarousel e.g.
Your data may have a
settingsobject withfocusOnSelect: true.You can set up the following
reInithandler method to keep things centered without having the initial render centered:This works because VueSlickCarousel watches your configuration props and re-renders automatically, so you can't dynamically set
centerModethis way. Instead, you dig deeper to the innerInnerSlidercomponent and set the property there.