This code should go AFTER foundation has been initialized, i.e.
<script>
$(document).foundation();
// equal-height.js code can go here
</script>
Then in your markup, just apply the data-match-height
attribute to your row markup, like so:
<div class="row" data-match-height>
...
</div>
This will ensure that panels will be all equal heights.