Skip to content

Instantly share code, notes, and snippets.

@JoshuaJones
Forked from nathanaelnsmith/blocks-equalize.js
Last active December 16, 2015 17:18
Show Gist options
  • Save JoshuaJones/5468963 to your computer and use it in GitHub Desktop.
Save JoshuaJones/5468963 to your computer and use it in GitHub Desktop.
$(function(){
$('.block-grid').each(function(index){
var $this = $(this),
blocks = $.makeArray($this.find('.block')).sort(sortByHeight)[0];
$this.find('.block').height($(blocks).height());
});
});
function sortByHeight(a,b) {
return ($(b).height() - $(a).height());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment