Skip to content

Instantly share code, notes, and snippets.

@gormus
Created November 15, 2013 19:07
Show Gist options
  • Save gormus/7489838 to your computer and use it in GitHub Desktop.
Save gormus/7489838 to your computer and use it in GitHub Desktop.
Based on the discussion found at foundation issue #1358 https://github.com/zurb/foundation/issues/1358#issuecomment-28546603
$(window).load(function() {
$("[data-match-height]").each(function() {
var parentRow = $(this),
childrenCols = $("> [data-height-watch]", this),
childHeights = childrenCols.map(function(){ return $(this).outerHeight(); }).get(),
tallestChild = Math.max.apply(Math, childHeights);
childrenCols.css('min-height', tallestChild);
});
});
[data-height-watch] {
border-left: 1px solid gray;
}
[data-match-height] > [data-height-watch][data-height-watch-novrule] {
border-left: 0 none;
}
@media only screen and (max-width:1023px) {
[data-height-watch] {
min-height: 1px !important;
border-left: 0 none !important;
}
}
<div class="row" data-match-height>
<div class="medium-12 large-9 large-push-3 columns" data-height-watch>
Main column on the right
</div>
<div class="large-3 large-pull-9 columns" data-height-watch data-height-watch-novrule>
Sidebar column on the left
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment