Items gap not working
Hi there, am i the only one here who cannot get the gap parameter to work?? *** i love the slider btw, nice work guys
I've been able to use the gap with no problems. What is the specific issue you're experiencing?
Even at the simple carousel (not grid) i am not able to give it the gap i want. Even without any gap parameter, i get all the items side by side with NO gap... I have inserted the css file even though this is not a CSS issue.
I have the same problem.
- Either images are aligned closely side by side
- Either random gap appears, but then last slide hides behind slider tail
Splidejs version: 2.4.20
Here is an example.
Play with perPage and gap values - set perPage to 4 or 6 and You will see difference.
https://codepen.io/arnisjuraga/pen/GRmwgeE
new Splide("#image-slider-nobootstrap", {
//perPage: 6, // 6 slides does not have gap!
perPage: 4, // 4 slides has gap, but last slide is hidden behind the tail of slider...
gap: "5rem",
classes: {
// Add classes for arrows.
prev: 'splide__arrow--prev splide-self-prev',
next: 'splide__arrow--next splide-self-next',
}
}).mount();
<div id="image-slider-nobootstrap" class="splide" style="width: 800px;">
<div class="splide__track">
<ul class="splide__list">
<li class="splide__slide"><img src="https://picsum.photos/id/237/200/300"></li>
<li class="splide__slide"><img src="https://picsum.photos/id/238/200/300"></li>
<li class="splide__slide"><img src="https://picsum.photos/id/239/200/300"></li>
<li class="splide__slide"><img src="https://picsum.photos/id/239/200/300"></li>
<li class="splide__slide"><img src="https://picsum.photos/id/1/200/300"></li>
<li class="splide__slide"><img src="https://picsum.photos/id/2/200/300"></li>
<li class="splide__slide"><img src="https://picsum.photos/id/3/200/300"></li>
</ul>
</div>
Close the issue due to the major version update. Feel free to create a new issue or open a new discussion.
That is because of style="width: 800px;. Remove it and use the width option.