Skip to content

Instantly share code, notes, and snippets.

@proweb
Created May 6, 2017 16:30
Show Gist options
  • Save proweb/7c872c02646659e45084c1d51dfc3018 to your computer and use it in GitHub Desktop.
Save proweb/7c872c02646659e45084c1d51dfc3018 to your computer and use it in GitHub Desktop.
Slick carousel equal height slides
$(window).load(function() {
$('.slides').on('setPosition', function () {
$(this).find('.slick-slide').height('auto');
var slickTrack = $(this).find('.slick-track');
var slickTrackHeight = $(slickTrack).height();
$(this).find('.slick-slide').css('height', slickTrackHeight + 'px');
});
})
@smotzart
Copy link

smotzart commented Apr 21, 2020

$('.slides').on('setPosition', function (event, slick) {
$(slick.$slides).height('auto').css('height', $(slick.$slideTrack).height() + 'px');
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment