Created
May 6, 2017 16:30
-
-
Save proweb/7c872c02646659e45084c1d51dfc3018 to your computer and use it in GitHub Desktop.
Slick carousel equal height slides
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(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'); | |
}); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$('.slides').on('setPosition', function (event, slick) {
$(slick.$slides).height('auto').css('height', $(slick.$slideTrack).height() + 'px');
});