jrobinsonc
10/14/2016 - 3:35 PM

Equal height

Equal height

var equalheight = function(container){

    $.each($(container), function(){

        var $container = $(this);
        var $items = $container.children('a');
        var gobalHeight = null;
        var level = 'max';

        $.each($items, function(){
            var $item = $(this);
            var itemHeight = $item.height();

            if (gobalHeight === null
                || (level === 'min' && itemHeight < gobalHeight)
                || (level === 'max' && itemHeight > gobalHeight)) {
                gobalHeight = itemHeight;
            }

        });

        $items.height(gobalHeight);

    });

}

jQuery( document ).ready(function($) {
    equalheight('.instagram-block');
});