Skip to content

Instantly share code, notes, and snippets.

@floriancargoet
Last active March 5, 2017 03:42
Show Gist options
  • Save floriancargoet/8853870 to your computer and use it in GitHub Desktop.
Save floriancargoet/8853870 to your computer and use it in GitHub Desktop.
Trello Grid
javascript:(function(){$('.list-area').css('max-width','100%');$('.list').css('margin','10px 0 0 10px');var max = Math.max.apply(null,$('.list').map(function(){return $(this).height();}));$('.list').each(function(){$(this).css('margin-bottom', max - $(this).height())});})();
(function(){
// disable horizontal scrolling
$('.list-area').css('max-width', '100%');
// fix margins
$('.list').css('margin', '10px 0 0 10px');
// compute max height
var max = Math.max.apply(null, $('.list').map(function(){
return $(this).height();
}));
// align cards by pushing them with margins
$('.list').each(function(){
$(this).css('margin-bottom', max - $(this).height());
});
// alternative: give them all the same height
/*
$('.list').height(Math.max.apply(null,$('.list').map(function(){return $(this).height();})));
*/
})();
@boaf
Copy link

boaf commented Apr 10, 2014

I would suggest fixing the overflow of the list wrapper:

$('.list-area-wrapper').css('overflow-y','auto');

Otherwise, great little snippet – thanks! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment