Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save firebelly/156774 to your computer and use it in GitHub Desktop.
Save firebelly/156774 to your computer and use it in GitHub Desktop.
(function($){
//meant to handle making floated lists that have elements of different heights
//display in nicely aligned columns like a table
$.fn.equalizeColumns = function() {
var prev_els_position = 0;
return this.each(function(i, el){
$(el).children("li").each(function(i, el){
if($(el).is(":floating")){
if($(el).position().top > prev_els_position)
$(el).css({clear: "left"});
}
prev_els_position = $(el).position().top;
});
});
}
})(jQuery)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment