resources/js/components/mixins/mixins.js
// our multi slide adaptive height function passing slider object
our multi slide adaptive height function passing slider object
our multi slide adaptive height function passing slider object
multiSlideAdaptiveHeight(slider) {
            let activeSlides = [];
            let tallestSlide = 0;
            setTimeout(function () {
                $('.slick-track .slick-active', $(slider)).each(function (item) {
                    console.log(activeSlides[item]);
                    console.log($(this).outerHeight());
                    activeSlides[item] = $(this).outerHeight();
                });
                activeSlides.forEach(function (item) {
                    if (item > tallestSlide) {
                        tallestSlide = item;
                    }
                });
                $('.slick-list', slider).height(tallestSlide);
            }, 10);
        }
multiSlideAdaptiveHeight ( slider ) { let activeSlides = [ ] ; let tallestSlide = 0 ; setTimeout ( function ( ) { $ ( '.slick-track .slick-active' , $ ( slider ) ) . each ( function ( item ) { console . log ( activeSlides [ item ] ) ; console . log ( $ ( this ) . outerHeight ( ) ) ; activeSlides [ item ] = $ ( this ) . outerHeight ( ) ; } ) ; activeSlides . forEach ( function ( item ) { if ( item > tallestSlide ) { tallestSlide = item ; } } ) ; $ ( '.slick-list' , slider ) . height ( tallestSlide ) ; } , 10 ) ; }
our multi slide adaptive height function passing slider object
our multi slide adaptive height function passing slider object
// set our vars // very short delay in order for us get the correct active slides // loop through each active slide for our current slider // add current active slide height to our active slides array // for each of the active slides heights // if current active slide height is greater than tallest slide height // override tallest slide height to current active slide height // set the current slider slick list height to current active tallest slide height