Last active
March 5, 2017 03:42
-
-
Save floriancargoet/8853870 to your computer and use it in GitHub Desktop.
Trello Grid
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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())});})(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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();}))); | |
*/ | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I would suggest fixing the overflow of the list wrapper:
Otherwise, great little snippet – thanks! 👍