-
-
Notifications
You must be signed in to change notification settings - Fork 437
Closed
Labels
feature requestNew feature or requestNew feature or request
Description
When using the 'fade' type, it would be very helpful to have an option to set the slider height based on the tallest slide.
At the moment I am doing it like this:
sliderHeight();
window.addEventListener('load', sliderHeight); //To allow for fonts loading
window.addEventListener('resize', sliderHeight);
function sliderHeight() {
if(document.querySelector('.my-slider .splide__list')) {
var list = document.querySelector('.banner-slider .splide__list');
list.style.height = '';
var slides = list.querySelectorAll('.splide__slide');
var h = slides[0].scrollHeight;
for (i=0; i < slides.length; i++) {
if(slides[i].scrollHeight > sliderH) {
h = slides[i].scrollHeight;
};
};
list.style.height = h + 'px';
};
};
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
feature requestNew feature or requestNew feature or request