Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to automatically set height of slick carousel

I'm using the slick caurousel for test. I am currently hard coding the height of the slides:

<div class="slides">
    <div>slide a</div>
    <div>slide b</div>
    <div>slide c</div>
</div>

CSS:

.slides {
    height: 200px;
}

What I would like, though, is for the carousel to automatically be the hight of the tallest slide. Is there a way to do this?

like image 325
Sam Lee Avatar asked Dec 10 '22 15:12

Sam Lee


1 Answers

$('.class').slick({
adaptiveHeight: true
});

Add the adaptiveHeight to set auto height of the image

like image 166
Praveen Avatar answered Dec 31 '22 09:12

Praveen