Is it possible to center a slider with less slides then defined in “items to show”?
I’ve got a dynamic slider populated by the loop showing the sibling pages in the menu tree. Items to show are set to 5, but there are sections with less then 5 subpages and they look a bit weird as there are emty slots for non existent items.
This is an easy fix, you just need to center the entire block/div in which the slider is inside of. Then even if the slider spans the entire width of the page (like your second row here), it should still look like the same as it does now. But if there’s less than 5 slider items it should center it.
So wrap your slider in a block and on that block use, under ‘Align cross axis’ > select ‘center’ (see below)
Hi @KOBE42, thanks for the advice, but I’m afraid that the slider doesn’t work this way.
The slider has several additional nested divs inside and the slider width itself is set to 100%. So wrapping the slider wouldn’t make any difference. Even aligning the slider itself doesn’t make any difference.
And if I would center the “splide__list”, which is the direct parent of all the slides, I would break the slider’s functionality, because all the scrolling relies on the fixed posssition of this element.
Well my point was, that first I wanted to ask, wheather the Bricks slider (aka SplideJS ) doesn’t have this feature prebuilt. Only if not, I would start with tweaking it.