Search code examples
zurb-foundationequalizer

Foundation 5 and Equalizer


I'll try to ask this here, because on Foundation forums I got no answer. I'm making a mixed layout and I want to use Equalizer to make the first column and the second column the same height. The catch is that the second column is another grid layout. Inside that second grid, Equalizer works like a charm, but between the first and second column it does nothing. I've searched here and there are a lot of people with similar problems, but I did not found a solution for mixed layout, even with simple jQuery functions. Anyone can help?

Here's the code:

<div class="row">
<div class="large-12 columns">
  <div class="row" data-equalizer>
    <!-- first column -->
    <div class="large-2 small-2 columns">
        <div class="panel" data-equalizer-watch>
        <!-- here goes an image -->
        </div>
    </div>
    <!-- second column -->
    <div class="large-10 small-10 columns" data-equalizer-watch>
        <div class="row" data-equalizer>
            <div class="large-4 small-12 columns">
                <p class="panel" data-equalizer-watch>Text</p>
            </div>
            <div class="large-4 small-12 columns">
                <p class="panel" data-equalizer-watch>Text</p>
            </div>
            <div class="large-4 small-12 columns">
                <p class="panel" data-equalizer-watch>Text</p>
            </div>
        </div>

        <div class="row">
            <div class="large-12 small-12 columns">
                <p class="panel">Longer text</p>
            </div>
        </div>

        <div class="row" data-equalizer>
            <div class="large-4 small-12 columns">
                <p class="panel" data-equalizer-watch>Text</p>
            </div>
            <div class="large-4 small-12 columns">
                <p class="panel" data-equalizer-watch>Text</p>
            </div>
            <div class="large-4 small-12 columns">
                <p class="panel" data-equalizer-watch>Text</p>
            </div>
        </div>

         <div class="row">
            <div class="large-12 small-12 columns">
                <p class="panel">Longer text</p>
            </div>
        </div>
    </div>
  </div>


</div>


Solution

  • I checked on version 5.2.2: you just cannot do this.

    I looked at Foundation foundation.equalizer.js file, this function is simply not suited for equalize an equalizer inside an equalizer.

    In 5.2.2 version, at line 30, you can see how it select elements to equalize:

    vals = equalizer.find('[' + this.attr_name() + '-watch]:visible')
    

    There is no dinstinction between dom levels, it catches every data-equalizer-watch without looking for any data-equalizer inside a data-equalizer