Looking to add a smooth slide down animation to some Slick sliders in my project.
Want the slider and "projects" button to smoothly slide down when the title above is clicked.
Currently, the slider/button container does slide down on click by toggling a class that changes the max-height of the container, but the slider and button just pop into view without any animation.
If you have any suggestions or code snippets for achieving a smooth slide down transition, please share them! View the codepen here
.service-content-wrapper {
margin: 0 auto;
width: 100%;
visibility: hidden;
margin-bottom: 25px;
max-height: 0;
transition: max-height 2s;
}
.accordion-content-wrapper {
background: blue;
}
.active {
max-height: 1000px;
visibility: visible;
}
-
$('.title-box').click(function() {
$(this).siblings('.service-content-wrapper').toggleClass('active');
});