Ta sama wysokość slajdów slick.js

0

Witam tworze stronę i napotkałem problem, nie działa mi poprawnie skrypt na ustawianie takiej samej wysokości box/slide. Skrypt daje poprawną wysokość zawsze po odświeżeniu strony lecz przy resize nadaje wartość 0 elementowi.
Ten skrypt ogólnie działa dobrze pierwszy raz spotkałem sie że przestał działac poprawnie.
Uzywam slidera -> http://kenwheeler.github.io/slick/

Proszę o pomoc :)
Pozdrawiam Jakub

function sameHeight(minWidth, cssClass) {
	if ($(window).width() > minWidth) {
		var items = $(cssClass), // grab all the slides
		heights = [], // array to store heights
		tallest; // tallest slide
		if (items.length) {
			function normalizeHeights() {
				items.each(function() {
					heights.push($(this).outerHeight()); // add each slide's
					// height
				}); // to the array
				tallest = Math.max.apply(null, heights); // find the largest
				// height
				items.each(function() {
					$(this).css('height', tallest + 'px'); // set each
					// slide's
					// minimum
				}); // height to the largest
			}
			;
			normalizeHeights();
			$(window).on('resize orientationchange', function() {
				tallest = 0, heights.length = 0; // reset the variables
				items.each(function() {
					$(this).css('height', '0'); // reset each slide's height
				});
				normalizeHeights(); // run it again
			});
		}
	}
}
	   <script>
	    window.onload = function() {
	        sameHeight(499,'#opinie .review_content'); 
    }
	    </script>
1

Znalzłem rozwiązanie :)
Może komuś się przyda! :)

 $('.nazwa_slider').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');
		   });

1 użytkowników online, w tym zalogowanych: 0, gości: 1