Auto height for mobile layouts #499
Unanswered
waveforcemedia
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Unfortunately, there is no easy way to do that because Splide enumerates slides by the flex layout. But you can achieve it by applying the height of the active slide content to the slider root element whenever the slider moves and the window is resized. splide.on( 'active', Slide => {
splide.root.style.height = `${ Slide.slide.firstElementChild.clientHeight }px`;
} ); (The code is just an idea) https://splidejs.com/guides/events/#active |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there a way to auto adjust the height for mobile based on the height of the content? Currently, it is taking the height of the biggest slide and then it leaves a gap on the bottom for shorter slides. I know it's possible to adjust the font size as the viewport shrinks....but since we are using bigger font/text for a slider, it does create gaps for certain slides.
Would this require CSS to fix?
BTW, thank you for this awesome slider! :)
Beta Was this translation helpful? Give feedback.
All reactions