Remove padding offset from the end of carousel #1116
erkkomakinen
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
Im trying to create slider that shows about one and a half slides at a time in mobile. Because Splide requires perPage to be integer i'm using padding to show part of the next slide. Here is the javascript code (not responsive yet):
const splide = new Splide(slider, {
pagination: false,
arrows: false,
gap: '1rem',
perPage: 1,
padding: { left: '1rem', right: '6rem' },
}).mount()
This works fine but it leaves empty space at the end of the carousel. Is it possible to remove this empty space somehow? Check out the attachment images.
I tried to do different things with negative margins but couldn't get it to work. Could it be possible to identify with JavaScript when it is the last slide and modify the movement so the last slide wouldn't go all the way to the end?
Beta Was this translation helpful? Give feedback.
All reactions